On Tuesday 04 April 2006 17:36, Kumar Appaiah wrote:
Hello! I thought people might find this tip useful. Often, we find
that we have many files with spaces in the filenames (moreso when they
are got from a Windoze user). Now, I find it very difficult to use
those files keeping the spaces in the names intact. So, I use
something like the following one liner to convert all spaces to `_'
(underscore) in the file names
for i in *jpg; do mv "$i" "`echo "$i"|sed 's/ /_/g'`"; done
Similar solutions with better error checking can be written. You can
also code this in Perl, Python or even AWK. But, this works...
Hope you found this useful.
Kumar