From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27534 invoked from network); 24 May 1998 07:56:43 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 24 May 1998 07:56:43 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id DAA18249; Sun, 24 May 1998 03:53:06 -0400 (EDT) Resent-Date: Sun, 24 May 1998 03:53:06 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199805240751.CAA21301@hzoli.home> Subject: Re: PWD parameter In-Reply-To: <980523225726.ZM5196@candle.brasslantern.com> from Bart Schaefer at "May 23, 98 10:57:26 pm" To: schaefer@brasslantern.com (Bart Schaefer) Date: Sun, 24 May 1998 02:51:55 -0500 (CDT) Cc: zsh-workers@math.gatech.edu X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"wbAUr3.0.4T4.Y7zPr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3993 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: > On May 23, 11:44pm, Zoltan Hidvegi wrote: > } Subject: PWD parameter > } > } The standard does not mention PWD or OLDPWD in the descriprion of the > } shell special parameters > > Personally, I rather like having PWD be a special parameter. If you go > by the letter of that standard you quoted, PWD would not be set at all > when the shell first started up; it would only become set after a "cd". > That's surely bogus. My patch does set PWD and OLDPWD on startup. The standard allows that but does not require it. Why do you think that PWD is better be a special parameter? Scripts do set PWD and if we want to allow people to use zsh as /bin/sh then we have to allow them to write PWD. That was my main reason for the patch, not the standard, since I link /bin/sh to zsh. If PWD is special, assignments will write directly to the internal pwd variable which can cause unexpected shell behavior. That's why PWD was read-only. Alternatively, you can just ignore assignments to PWD without giving an error message, but that's a bad solution. As long as you do not try to assign PWD, my patch does not change zsh's behavior, other than exporting OLDPWD which was not exported before. Zoltan