i'm trying to write a script that'll count all my files and directories that i have. everything seems to be fine untill it get to the 'foreach' loop. i really can't figur out what's wrong with it.
some one please give me few pointers.
---------------------------------------------------------
#!/bin/csh
echo ~
find ~ -type d | grep -v backup > dirlist
wc -l dirlist
cat dirlist
foreach name(`cat dirlist`)
echo inside directory $name:
echo `find $name -type d | wc -l` directories
echo `find $name -type f | wc -l` files
end
echo i have `find . -type f | wc -l` files
----------------------------------------------------------
Thanx
some one please give me few pointers.
---------------------------------------------------------
#!/bin/csh
echo ~
find ~ -type d | grep -v backup > dirlist
wc -l dirlist
cat dirlist
foreach name(`cat dirlist`)
echo inside directory $name:
echo `find $name -type d | wc -l` directories
echo `find $name -type f | wc -l` files
end
echo i have `find . -type f | wc -l` files
----------------------------------------------------------
Thanx