actually, this will not work, since file names with a space in them will be parsed as two (or more) separate words, in the for-loop.

Meir Kriheli wrote:

Aaron wrote:

Hi all,

lately I have had to deal with a lot of windoze filenames and am
wondering if ther is a utility/script to remove the spaces
automatically.

Thanks
Aaron


You can use bash replacement feature:

# A="Hello This is a test"

# echo $A
Hello This is a test

# echo ${A// /}
HelloThisisatest

A simple for loop and mv should handle it, example:

for i in *; do mv "$i"  "${i// /}"; done

If you have lots files in a dir, it could pose a problem, using find and -exec can help with that.


-- Meir Kriheli http://mksoft.co.il

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]



Reply via email to