Originally posted by: nagger
There are lots of bugs in here.
1) textfile spelt teixfile
2) You assign textfile and then cat out1.txt
3) my ls -al only has 9 columns so awk print $10 returns nothing
4) You have commented out stuff - I guess you are trying to debug it
5) What is the point of echoing 'exit 2' ?
6) $directory2 is used but not set
7) $line is set in a commented out line
8) the counts are not output at the end
and more ...
What are you trying to do?
I can't help thinking it must be easier to start again.
If you are trying to compare two directories ...
How about: diff -h -b Dir1 Dir2