Moving files

Bob Bell bobbell at zk3.dec.com
Tue Jan 7 11:34:36 EST 2003


On Tue, Jan 07, 2003 at 10:27:12AM -0500, Rodent of Unusual Size <Ken.Coar at golux.com> wrote:
> find . -name \*\ \* | (while read foo ; do mv "$foo" `echo $foo | sed -e 
> 's/ /_/g;'` ; done)

    I think that'll break if directories contain spaces -- easily fixed
with "-type f" if you don't want to rename directories; a little
trickier if you do (check my example).  Oh, and I don't think the parens
are needed.

-- 
Bob Bell <bobbell at zk3.dec.com>
-------------------------------------------------------------------------
 "One reason that few people are aware there are programs running the
  internet is that they never crash in any significant way: the free
  software underlying the internet is reliable to the point of
  invisibility. "
   -- Glyn Moody at http://www.guardianunlimited.co.uk/



More information about the gnhlug-discuss mailing list