[aclug-L] Re: Working on file names
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Thanx Carl, this got me on the right track. I had wanted
to replace the blank space with an underline. A little
research on the tr command and I figured that out. Thanx
for the point in the right direction.
Here's what worked for me...
for n in *; do mv "$n" `echo "$n" | tr " " "_" `; done
So cool, I love this linux stuff!
wayne
At 10:43 AM 03/22/2000 -0600, you wrote:
>On Wed, 22 Mar 2000, Wayne White wrote:
>
>> I need to remove the blank spaces from a bunch of file
>> names (MP3z). I know if it was a list in a text file
>> that it would be a simple thing to script bash to do it.
>> What I don't know is how to get it to work on the file
>> name themselves, or if that can even be done. Would
>> anyone like to weigh in with advice?
>
>In bash/ksh, cd to the directory containing the files, then...
>
>for n in *; do mv "$n" `echo $n |tr -d " "`; done
>
>--
>Carl D Cravens (raven@xxxxxxxxxxx)
>I buy you sigs, and I buy you sigs, but all you do is eat the bits!
>
>
>-- This is the discussion@xxxxxxxxx list. To unsubscribe,
>visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
>
>
-- This is the discussion@xxxxxxxxx list. To unsubscribe,
visit http://tmp2.complete.org/cgi-bin/listargate-aclug.cgi
|
|