> -----Original Message-----
> From: BigBrother (BigB3) [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 18:02
> Subject: Renaming files with spaces in the name to files 
> without spaces..
> Hash: SHA1
> Sorry for this OT but I am trying for some hours to achieve a massive
> rename of files using a simple script and I have not success 
> yet. I want
> to rename files like
> "RESULTS OF JAN 01 2002.txt "
> to
> "RESULTS_OF_JAN_01_2002.txt"

your input | sed "s/ *$//
s/ /_/g"

The first line means 'remove all spaces before the end of
the line', the second mean 'change all spaces to
underscores', and if you don't close the quotes, sed will
run this one after the other.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to