home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] stupid bash question

I know you're asking for a bash script, but I can send you a python script that will do the job.


alayne [ at ] twobikes [ dot ] ottawa [ dot ] on [ dot ] ca wrote:
I have two directories which are mostly the same. I need to compare the files in them (using cmp) to confirm this.

Unfortunately, some of the files (which Other People created, not me) have blanks in the filenames.

I thought I could just go

for i in `cat ListOfFiles`
cmp $i $OtherDirectory/$i

but it fails on all files with blanks in them.

If I edit ListOfFiles to put \ (or \\) before the blanks, that doesn't work any better (although that worls on an ordinary command line. Neither does putting "" around the filenames in the cmp.

Does anyone have any better suggestions? I'm obviously missing something.