TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:18790] quick way to strip spaces...



Brian Ackermann wrote:
> 
> > From: Mike Hicks <hick0088@tc.umn.edu>
> > Reply-To: tclug-list@mn-linux.org
> > Date: Fri, 09 Jun 2000 15:05:38 -0500
> > To: tclug-list@mn-linux.org
> > Subject: Re: [TCLUG:18790] quick way to strip spaces...
> >
> >
> > Actually, I think you may not be correctly encapsulating the $i's..  It
> > might work better to use
> >
> > for i in `find -name *.mp3'; do mv "$i" `echo $i | sed s/\ /-/`; done
> 
> I'm getting an error with this, and I'm not seeing what is wrong...::
> 
> bash:  syntax error near unexpected token `|'
> 
> any suggestions...?

Hmm.. I see that I missed a backquote...  Maybe this would work:

for i in `find -name *.mp3`; do mv "$i" `echo $i | sed s/\ /-/`; done

or this, if you want to avoid the confusing backquotes:

for i in $(find -name *.mp3); do mv "$i" $(echo $i | sed s/\ /-/); done

-- 
 _  _  _  _ _  ___    _ _  _  ___ _ _  __   Don't panic, don't 
/ \/ \(_)| ' // ._\  / - \(_)/ ./| ' /(__   panic...  Oops. 
\_||_/|_||_|_\\___/  \_-_/|_|\__\|_|_\ __)                             
[ Mike Hicks | http://umn.edu/~hick0088/ | mailto:hick0088@tc.umn.edu ]