SLUG Mailing List Archives
[SLUG] spaces in filenames - bash scripting problem
- To: slug@xxxxxxxxxxx
- Subject: [SLUG] spaces in filenames - bash scripting problem
- From: david <david@xxxxxxxxxxxxx>
- Date: Sat, 20 May 2006 14:52:39 +1000
- Reply-to: david@xxxxxxxxxxxxx
The scrip works as long as there are no blanks.... unfortunately there
are lots of blanks in both directories and filenames. Can anyone tell me
what i should be doing?
# takes the first 3 chars of each directory and
# prepends it to the file names in that directory.
for x in $(ls)
y=$(echo $x | cut -c -3)
for z in $(ls $x)
mv $x/$z $x/$y$z