Date: Tue, 31 Aug 1999 05:47:49 +0100 From: Brian Somers <brian@Awfulhak.org> To: Greg Lehey <grog@lemis.com> Cc: Brian Somers <brian@Awfulhak.org>, Roelof Osinga <roelof@nisser.com>, Patrick Seal <patseal@hyperhost.net>, freebsd-questions@FreeBSD.ORG Subject: Re: Bash: space in cd arg bug? Message-ID: <199908310447.FAA27918@keep.lan.Awfulhak.org> In-Reply-To: Your message of "Tue, 31 Aug 1999 11:52:27 %2B0930." <19990831115226.X13904@freebie.lemis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> On Tuesday, 31 August 1999 at 0:02:20 +0100, Brian Somers wrote: > > [.....] > >>> You missed the > >>> > >>> zsh -> echo $FOO > >>> /C:/Program Files > >>> zsh -> mkdir $FOO > >>> > >>> Which makes two directories. Why should ``cd'' behave differently > >>> from an external command - just because it's a builtin ? > >> > >> It shouldn't. > >> > >>> IMHO, zsh is wrong. > >> > >> Agreed. And bash does exactly the same thing in this case. > > > > Someone said that ``cd $FOO'' was being interpreted as > > ``cd "Program Files"'' (two words) rather than as > > ``cd Program Files'' (three words). The correct interpretation > > (which is the same as bash's interpretation) is as three words. > > Why is this correct? How do I store a directory name which contains > in a variable and then change to it? It's not correct just to cd $* > instead of cd $1, because there could be multiple contiguous spaces in > the directory name. No, it's correct to ``cd "$FOO"'' if you want to allow characters in $IFS to be embedded in $FOO. > Greg > -- > See complete headers for address, home page and phone numbers > finger grog@lemis.com for PGP public key > -- Brian <brian@Awfulhak.org> <brian@FreeBSD.org> <http://www.Awfulhak.org> <brian@OpenBSD.org> Don't _EVER_ lose your sense of humour ! <brian@FreeBSD.org.uk> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908310447.FAA27918>