Byron Clark wrote:
> On Tue, Jan 13, 2009 at 08:41:19PM -0700, Alec Shaw wrote:
>> Actually as I think about it maybe a bash or ksh (after years of use ksh  
>> is still my preferred shell) script
>> would be better.  Maybe a "for f in *; do mv $f $g; done" but how do I  
>> get $g from $f with spaces substituted?
> 
> bash:
> for f in *; do mv $f ${f// /_}; done

It's probably best to quote "$f," no?

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

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to