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

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



Mike Hicks wrote:
> 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

I don't think these will work as expected because the for splits on
spaces. :-(


-- 
Troy Johnson   mailto:john1536@tc.umn.edu   http://umn.edu/~john1536/
It is the assumption of this book that a work of art is a gift, not a
commodity.  Or, to state the modern case with more precision, that works
of
art exist simultaneously in two "economies," a market economy and a gift
economy.  Only one of these is essential, however: a work of art can
survive
without the market, but where there is no gift there is no art.
	-- Lewis Hyde, The Gift: Imagination and the Erotic Life of Property