From owner-freebsd-questions Mon Aug 30 21:46:54 1999 Delivered-To: freebsd-questions@freebsd.org Received: from awfulhak.org (dynamic-67.max1-du-ws.dialnetwork.pavilion.co.uk [212.74.8.67]) by hub.freebsd.org (Postfix) with ESMTP id 6B026153B8 for ; Mon, 30 Aug 1999 21:46:50 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from keep.lan.Awfulhak.org (root@keep.lan.Awfulhak.org [172.16.0.8]) by awfulhak.org (8.9.3/8.9.3) with ESMTP id FAA30127; Tue, 31 Aug 1999 05:44:02 +0100 (BST) (envelope-from brian@lan.awfulhak.org) Received: from keep.lan.Awfulhak.org (brian@localhost.lan.Awfulhak.org [127.0.0.1]) by keep.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id FAA27918; Tue, 31 Aug 1999 05:47:50 +0100 (BST) (envelope-from brian@keep.lan.Awfulhak.org) Message-Id: <199908310447.FAA27918@keep.lan.Awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Greg Lehey Cc: Brian Somers , Roelof Osinga , Patrick Seal , freebsd-questions@FreeBSD.ORG Subject: Re: Bash: space in cd arg bug? In-reply-to: Your message of "Tue, 31 Aug 1999 11:52:27 +0930." <19990831115226.X13904@freebie.lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 31 Aug 1999 05:47:49 +0100 From: Brian Somers Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message