Hello all! I am (unsuccessfully) trying to arrange the usermod and permissions on some 5.000 folders and 20.000 files. (My music collection) I cant for my life compose a script that: a. Will set all directories to chmod 755 b, will set all regular files to perm 644 i tried a fairly simple script: #!/bin/sh ls -R * | while read f do echo $f if [ -f $f ]; then chmod 644 $f fi done the layout of the files is something like the following: /1_sort/Bon Jovi/Crossroads (Best of 84-94) Crossroad (best of 84-94) - 01 - Livin' On A Prayer.mp3 Crossroad (best of 84-94) - 02 - Keep The Faith.mp3 Crossroad (best of 84-94) - 03 - Someday I'll Be Saturday Night.mp3 Crossroad (best of 84-94) - 04 - Always.mp3 Crossroad (best of 84-94) - 05 - Wanted Dead Or Alive.mp3 Crossroad (best of 84-94) - 06 - Lay Your Hands On Me.mp3 Crossroad (best of 84-94) - 07 - You Give Love A Bad Name.mp3 Crossroad (best of 84-94) - 08 - Bed Of Roses.mp3 Crossroad (best of 84-94) - 09 - Blaze Of Glory.mp3 Crossroad (best of 84-94) - 10 - In These Arms.mp3 Crossroad (best of 84-94) - 11 - Bad Medicine.mp3 Crossroad (best of 84-94) - 12 - I'll Be There For You.mp3 Crossroad (best of 84-94) - 13 - In & Out Of Love.mp3 Crossroad (best of 84-94) - 14 - Runaway.mp3 Crossroad (best of 84-94) - 15 - Never Say Goodbye.mp3 But running the script yields: chmod: cannot access `$f': No such file or directory 1_Sort_me/Bon Jovi/Crossroads (Best of 84-94): -bash: [: too many arguments Crossroad (best of 84-94) - 01 - Livin' On A Prayer.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 02 - Keep The Faith.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 03 - Someday I'll Be Saturday Night.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 04 - Always.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 05 - Wanted Dead Or Alive.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 06 - Lay Your Hands On Me.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 07 - You Give Love A Bad Name.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 08 - Bed Of Roses.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 09 - Blaze Of Glory.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 10 - In These Arms.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 11 - Bad Medicine.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 12 - I'll Be There For You.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 13 - In & Out Of Love.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 14 - Runaway.mp3 -bash: [: too many arguments Crossroad (best of 84-94) - 15 - Never Say Goodbye.mp3 -bash: [: too many arguments Can anyone tell me what i do wrong, and how to write it properly?