Filename conversion
Chris F.A. Johnson
c.f.a.johnson-bJEeYj9oJeDQT0dZR+AlfA at public.gmane.org
Sun Apr 11 23:40:27 UTC 2004
On Sun, 11 Apr 2004, John Wildberger wrote:
> I imported from an XP OS a number of files into Linux. These files have names
> like "Set1 001.png" with a space beteen the Set1 and 001.png. These are
> picture files and can be displayed by by GIMP without a hitch inspite of the
> space char.
> However, anything else I want to do with these files fails due to the presence
> of the space. Any individual file can be renamed without problems, thereby
> eliminating the space char. However, this is quite cumbersome if there are a
> great number of files.
> Question: Is there an efficient way (perl ??) to deal with this for all such
> files in a particular directory?
It's easy to convert them with bash:
for file in *\ *
do
mv "$file" "${file// /_}"
done
--
Chris F.A. Johnson http://cfaj.freeshell.org
=================================================================
Everything in moderation -- including moderation
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list