Vim question

Michael Torrie torriem at
Tue Jan 13 21:18:13 MST 2009

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

More information about the PLUG mailing list