[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Maybe offtopic: Dealing with filenames with blanks in a script



 --- Dave Thorn <davet@fysh.org> wrote: 

> On Thu, Apr 29, 2004 at 12:05:59PM +0200, Richard Lyons wrote:
> > 
> > Does that mean I could have a script to convert all those horrible 
> > filenames people give you from the dark side - the ones like
> > "Some Thoughts About Your Proposition.doc".  A simple script to
> replace 
> > all the spaces with underscores.  

Something like this:

rename 's/ /_/g' *

Of course, to be more thorough:

find . -type -f -maxdepth 1 -print0 | xargs -0 rename's/ /_/g'

-- Thomas Adam

=====
"The Linux Weekend Mechanic" -- http://linuxgazette.net
"TAG Editor"                 -- http://linuxgazette.net

"<shrug> We'll just save up your sins, Thomas, and punish 
you for all of them at once when you get better. The 
experience will probably kill you. :)"

 -- Benjamin A. Okopnik (Linux Gazette Technical Editor)


	
	
		
____________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html



Reply to: