From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id FAA05131 for ; Wed, 25 Sep 1996 05:48:17 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id PAA04188; Tue, 24 Sep 1996 15:41:52 -0400 (EDT) Resent-Date: Tue, 24 Sep 1996 15:41:52 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199609241942.VAA09915@bolyai.cs.elte.hu> Subject: Re: argzero while sourcing standard scripts In-Reply-To: <199609161009.MAA19596@hydra.ifh.de> from Peter Stephenson at "Sep 16, 96 12:09:10 pm" To: pws@ifh.de (Peter Stephenson) Date: Tue, 24 Sep 1996 21:42:02 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL27 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"Ypkg61.0.J11._b3Io"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2168 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Peter Stephenson wrote: > Zsh doesn't set argzero (i.e. $0) while sourcing standard scripts, > although it does when sourcing anything else so long as > FUNCTIONARGZERO is set (which it is by default for native emulation > and I can't think of a good reason for turning it off for a `real' > zsh). This means the error messages from standard scripts are rather > unhelpful in that you don't get the name of the script with the error. It is certainly wrong that the filename isn't mentioned in the error message but setting argzero it probably the wrong solution for that. One may want to invoke zsh under different names to get customized behaviour. In the startup files $0 can be used to decide the prefered option settings etc. OK, the ZSH_NAME parameter can be used for that. But when you execute a script $0 is set to the script name which can be used in zshenv. Setting $0 to zshenv would make it impossible to get the name of the script we are executing. Zoltan