From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14636 invoked from network); 14 Apr 1997 18:49:25 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 14 Apr 1997 18:49:25 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id OAA09401; Mon, 14 Apr 1997 14:43:10 -0400 (EDT) Resent-Date: Mon, 14 Apr 1997 14:43:10 -0400 (EDT) From: (Zoltan T. Hidvegi) Message-Id: <9704141845.AA18192@lotto.fishkill.ibm.com> Subject: Re: zsh not sourcing /etc/profile? In-Reply-To: from Richard Coleman at "Apr 14, 97 01:42:44 pm" To: coleman@math.gatech.edu (Richard Coleman) Date: Mon, 14 Apr 1997 14:45:49 -0400 (EDT) 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: <"PUkMT2.0.nI2.zgdKp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3074 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Richard Coleman wrote: > I found this article on comp.unix.shells. I thought I would > pass it along. [...] > > posix-sh, ksh, and bash all return the name of the shell for $0 when > > sourcing a file. > > > > Only zsh returns the name of the file being sourced. I suspect the > > right behaviour is to return the shell name. The reason for this is > > that sourcing a file does not create a new process, it should behave > > as if the file had been typed from the keyboard. If you type the > > command "echo $0" at the prompt, it should return the shell name. > > Although I really like zsh, I think it does not have the right > > behaviour because you can't rely on $0 to determine which shell is > > interpreting the file. Under zsh this is controlled by the FUNCTION_ARGZERO option, which is set when zsh is started as sh/ksh. Zoltan