recursively changing chars in filenames

Smoot Carl-Mitchell smoot at tic.com
Sat Jun 27 22:31:24 BST 2009


On Sat, 2009-06-27 at 22:19 +0200, Soren Orel wrote:
> Thank you, but it still gives error, because I can't cd to a dir
> containing spaces, like:
> 
> cd /home/user/some dir what has spaces/something
> 

Sure you can.  Just enclose the $1 argument in your script in double
quotes.  The cd will then take it as a single argument and do the right
thing.  It is the shell that is expanding the $1 and then seeing the
whitespace as argument separators.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list