[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Directories with spaces
From: |
Chris F.A. Johnson |
Subject: |
Re: Directories with spaces |
Date: |
Wed, 8 Sep 2004 23:01:41 -0400 (EDT) |
On Thu, 9 Sep 2004, Matthew Walker wrote:
I have a number of directories with spaces in their names. I wanted to write
a script that steps through them but found it was difficult to cd to dirs
with spaces. Would someone mind giving me a few suggestions?
$ mkdir "My Directory With Spaces"
$ cd "My Directory With Spaces" # works fine
$ cd ..
$ a="cd \"My Directory With Spaces\""
$ echo $a
cd "My Directory With Spaces"
$ $($a) # I thought this would work
bash: cd: "My: No such file or directory
eval "$a"
Or:
a="My Directory With Spaces"
cd "$a"
--
Chris F.A. Johnson http://cfaj.freeshell.org
=================================================================
Everything in moderation -- including moderation