From owner-freebsd-questions Mon Aug 30 19:24:25 1999 Delivered-To: freebsd-questions@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id 2EFC1150B7 for ; Mon, 30 Aug 1999 19:24:14 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id LAA02104; Tue, 31 Aug 1999 11:52:29 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id LAA80638; Tue, 31 Aug 1999 11:52:27 +0930 (CST) Date: Tue, 31 Aug 1999 11:52:27 +0930 From: Greg Lehey To: Brian Somers Cc: Roelof Osinga , Patrick Seal , freebsd-questions@FreeBSD.ORG Subject: Re: Bash: space in cd arg bug? Message-ID: <19990831115226.X13904@freebie.lemis.com> References: <19990827153243.V483@freebie.lemis.com> <199908302302.AAA09780@keep.lan.Awfulhak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199908302302.AAA09780@keep.lan.Awfulhak.org>; from Brian Somers on Tue, Aug 31, 1999 at 12:02:20AM +0100 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 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. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message