[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Using stupid filenames in shell scripts



I have copied some mp3 containing directories from a windows
partition. In the days I created those files it seemed like a good
idea to use filenames such as:

01 - Artist - Song1.mp3
02 - Artist - Song2.mp3
etc.

When I want to do anything useful with these files, I'd like to use a
script to avoid repeating the same action say 15 times.

For instance, I'd use something like:

for i in `ls`; do echo $i; done

This doesn't work properly. $i gets a lot of values like 01, -,
Artist, Song.mp3 instead of one value per file.

Do I need to rename the files prior to using a script or can I
change the script to use those insane file names in the way I intend
them to be used?

Bob



Reply to: