Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 1999 18:01:08 +0200
From:      Roelof Osinga <roelof@nisser.com>
To:        Greg Lehey <grog@lemis.com>
Cc:        Brian Somers <brian@Awfulhak.org>, Patrick Seal <patseal@hyperhost.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Bash: space in cd arg bug?
Message-ID:  <37C6B644.76441221@nisser.com>
References:  <19990825114804.E83273@freebie.lemis.com> <199908270557.GAA68309@keep.lan.Awfulhak.org> <19990827153243.V483@freebie.lemis.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Greg Lehey wrote:
> 
> ...
> > 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.

It's way too early for me to be looking at this, especially since I
switched to tea, but... I don't see the problem. Which usually means
I'm overlooking something, so if someone could point it out to me
slowly it will be appreciated.

nisser:~$ FOO="Program Files"
nisser:~$ echo $FOO
Program Files
nisser:~$ pushd $FOO
bash: pushd: Program: No such file or directory
nisser:~$ cd $FOO
bash: cd: Program: No such file or directory

The thing I fail to see is why y'all seemingly want parameter
substitution to do something it doesn't. What the shell does is
to substitute the contents of $FOO for occurance.

Clearly, if I do the substition:

nisser:~$ cd Program Files
bash: cd: Program: No such file or directory

it fails. So why shouldn't it fail when the shell does it?

Then again, another thing that is beyond me is why this fails:

nisser:~$ FOO='"Program Files"'
nisser:~$ echo $FOO
"Program Files"
nisser:~$ cd $FOO
bash: cd: "Program: No such file or directory
nisser:~$ pushd $FOO
bash: pushd: "Program: No such file or directory
nisser:~$ csh
% cd $FOO
cd: Too many arguments.
nisser:~$ sh
\h:\w\$ cd $FOO
cd: can't cd to "Program

Well, at least it's consistent <g>.

Roelof

-- 
Home is where the (@) http://eboa.com/ is.


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?37C6B644.76441221>