29 May
2006
29 May
'06
12:56
On Saturday 27 May 2006 12:09, Rikard Johnels wrote:
ls -R * | while read f do if [ -f $f ]; then chmod 644 $f fi done
Unfortunately the filenames contain spaces... And thus i get all kinds of errors from the chmod stage
2004 So Called Chaos -bash: [: too many arguments
And the stupid part is i cant for my life understand how to get the script to enclose the $f with " "
I did not test it, but I would code it as this: ls -R * | while read f; do if [ -f "$f" ]; then chmod 644 "$f" fi done Cheers, Leen