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

2004-07-15 Thread Luke A. Kanies
On Thu, 15 Jul 2004, Matthias Czapla wrote: 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

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

2004-07-15 Thread Matthias Czapla
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 wit

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

2004-07-15 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 10:54:59AM +0800, John Summerfield wrote: > >BTW, what are all those files in your home directory? I have only > >about 14000 and thought that this is the biggest mess ever ;) > > Oh, stuff. source of debs, built and otherwise. CVS checkouts of stuff. > Documents. Photos (s

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

2004-07-15 Thread John Summerfield
Sturla Holm Hansen wrote: BTW, what are all those files in your home directory? I have only about 14000 and thought that this is the biggest mess ever ;) Oh, stuff. source of debs, built and otherwise. CVS checkouts of stuff. Documents. Photos (see my sig for some). IBM operating systems. Lot

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

2004-07-15 Thread Sturla Holm Hansen
John Summerfield wrote: Matthias Czapla wrote: On Thu, Jul 15, 2004 at 09:05:54AM +0800, John Summerfield wrote: I don't use -exec on find any more because it's slow. When you pipe the names into xargs as I do, then spaces cause the problem I described. Well, until now I didnt even know a

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

2004-07-14 Thread Luke A. Kanies
On Wed, 14 Jul 2004, j smith wrote: md5sum checks one file a time. i want a script that recursively check files in a directory.Thanks! PS: the script's application: in DOS 6, there is antivirus program called "msav" that check if executables are changed or infected. such program is no longer availa

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

2004-07-14 Thread John Summerfield
Matthias Czapla wrote: On Thu, Jul 15, 2004 at 09:05:54AM +0800, John Summerfield wrote: I don't use -exec on find any more because it's slow. When you pipe the names into xargs as I do, then spaces cause the problem I described. Well, until now I didnt even know about xargs' purpose, tha

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

2004-07-14 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 09:05:54AM +0800, John Summerfield wrote: > I don't use -exec on find any more because it's slow. When you pipe the > names into xargs as I do, then spaces cause the problem I described. Well, until now I didnt even know about xargs' purpose, thanks for the pointer. > Fo

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

2004-07-14 Thread John Summerfield
Matthias Czapla wrote: On Thu, Jul 15, 2004 at 07:14:30AM +0800, John Summerfield wrote: find ~ -type f -exec cat {} \; This fails because cat doesn't check anything - it just copies all files to stdout It doesn't handle files whose names contain spaces Hu? I used cat solely

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

2004-07-14 Thread Alan Shutko
John Summerfield <[EMAIL PROTECTED]> writes: > Since he specifically said he wants to use mdsum, it's clearer to use > the program he said he wants to use. > > Try it and see what happens. [19:24:27] wesley:~/tmp/t $ ls -l total 4 -rw-r--r--1 ats ats 2344 2004-07-14 19:23 a b c

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

2004-07-14 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 02:21:52AM +0200, Matthias Czapla wrote: > > The problem is that fragments of file names separated by spaces are > > indistinguishable from filenames separated by spaces. > > This is only true when the command line is being split into words, e.g. > by the shell. find's '{}

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

2004-07-14 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 07:14:30AM +0800, John Summerfield wrote: > >>>find ~ -type f -exec cat {} \; > >> > >>This fails because > >>cat doesn't check anything - it just copies all files to stdout > >>It doesn't handle files whose names contain spaces > > > >Hu? I used cat solely for the purpose o

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

2004-07-14 Thread John Summerfield
Matthias Czapla wrote: On Thu, Jul 15, 2004 at 06:06:26AM +0800, John Summerfield wrote: find ~ -type f -exec cat {} \; This fails because cat doesn't check anything - it just copies all files to stdout It doesn't handle files whose names contain spaces Hu? I used cat solely for the

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

2004-07-14 Thread John Summerfield
Matthias Czapla wrote: On Thu, Jul 15, 2004 at 06:07:26AM +0800, John Summerfield wrote: Matthias Czapla wrote: On Wed, Jul 14, 2004 at 02:31:10PM -0700, j smith wrote: Thank you! Windows has folder names that include space, Example:"Program Files" Will that cause trouble for your so

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

2004-07-14 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 06:07:26AM +0800, John Summerfield wrote: > Matthias Czapla wrote: > >On Wed, Jul 14, 2004 at 02:31:10PM -0700, j smith wrote: > >>Thank you! > >> > >>Windows has folder names that include space, > >>Example:"Program Files" > >> > >>Will that cause trouble for your solution?

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

2004-07-14 Thread Matthias Czapla
On Thu, Jul 15, 2004 at 06:06:26AM +0800, John Summerfield wrote: > > > >find ~ -type f -exec cat {} \; > > > > > This fails because > cat doesn't check anything - it just copies all files to stdout > It doesn't handle files whose names contain spaces Hu? I used cat solely for the purpose of show

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

2004-07-14 Thread John Summerfield
Matthias Czapla wrote: On Wed, Jul 14, 2004 at 02:31:10PM -0700, j smith wrote: Thank you! Windows has folder names that include space, Example:"Program Files" Will that cause trouble for your solution? If the command after the -exec is a "real" program and not a shell script or something e

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

2004-07-14 Thread John Summerfield
Matthias Czapla wrote: On Wed, Jul 14, 2004 at 10:09:18AM -0700, j smith wrote: md5sum checks one file a time. i want a script that recursively check files in a directory.Thanks! PS: the script's application: in DOS 6, there is antivirus program called "msav" that check if executables are change

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

2004-07-14 Thread John Summerfield
j smith wrote: md5sum checks one file a time. i want a script that recursively check files in a directory.Thanks! PS: the script's application: in DOS 6, there is antivirus program called "msav" that check if executables are changed or infected. such program is no longer available is Windows, so i

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

2004-07-14 Thread Matthias Czapla
On Wed, Jul 14, 2004 at 02:31:10PM -0700, j smith wrote: > Thank you! > > Windows has folder names that include space, > Example:"Program Files" > > Will that cause trouble for your solution? If the command after the -exec is a "real" program and not a shell script or something else that interpr

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

2004-07-14 Thread j smith
Thank you! Windows has folder names that include space, Example:"Program Files" Will that cause trouble for your solution? --- Matthias Czapla <[EMAIL PROTECTED]> wrote: > On Wed, Jul 14, 2004 at 10:09:18AM -0700, j smith > wrote: > > md5sum checks one file a time. i want a script > that > > rec

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

2004-07-14 Thread Andreas Janssen
Hello j smith (<[EMAIL PROTECTED]>) wrote: > md5sum checks one file a time. i want a script that > recursively check files in a directory.Thanks! Something like find /usr -xdev -type f -name "*" -printf "\"%p\" \n" | xargs md5sum >\ usr.md5 or (untested) find /usr -xdev -type f -print0 | xarg

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

2004-07-14 Thread Matthias Czapla
On Wed, Jul 14, 2004 at 10:09:18AM -0700, j smith wrote: > md5sum checks one file a time. i want a script that > recursively check files in a directory.Thanks! > > PS: the script's application: in DOS 6, there is > antivirus program called "msav" that check if > executables are changed or infected

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

2004-07-14 Thread LeVA
2004. jĂșlius 14. 19:09, j smith <[EMAIL PROTECTED]> -> [EMAIL PROTECTED]: > md5sum checks one file a time. i want a script that > recursively check files in a directory.Thanks! > > PS: the script's application: in DOS 6, there is > antivirus program called "msav" that check if > executables are ch

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

2004-07-14 Thread j smith
md5sum checks one file a time. i want a script that recursively check files in a directory.Thanks! PS: the script's application: in DOS 6, there is antivirus program called "msav" that check if executables are changed or infected. such program is no longer available is Windows, so i want a script