[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to write a script that recursively check files in a directory with md5sum



On Thu, Jul 15, 2004 at 02:18:55PM +0200, Sturla Holm Hansen wrote:
> Since I'm kinda new at this I just have to ask what's wrong with a
> for-loop..
> To slow?

Depends on what you do in the loop's body.

> I have no idea, but I use something like this to recurse down a tree and
> do something with every file:
> 
> #!/bin/bash
> for i in `find -type f`
> do
>      whatever you wan't to do, just use $i instead of the filename.
> done

This will not work if any component of a path contains spaces. If
this is not the case then there is nothing wrong with this approach,
IMHO.

Regards
Matthias



Reply to: