From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15160 invoked from network); 5 Jun 1998 07:50:24 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 5 Jun 1998 07:50:24 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id DAA15457; Fri, 5 Jun 1998 03:39:00 -0400 (EDT) Resent-Date: Fri, 5 Jun 1998 03:39:00 -0400 (EDT) Message-Id: <199806050739.JAA27113@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Cc: "Andrej Borsenkow" Subject: Re: sourcing of /etc/profile with $0 == -sh In-reply-to: ""Andrej Borsenkow""'s message of "Fri, 05 Jun 1998 10:36:41 MST." <003801bd904c$4df7c680$21c9ca95@ao13.mow.sni.de> Date: Fri, 05 Jun 1998 09:39:55 +0200 From: Peter Stephenson Resent-Message-ID: <"S2GXh.0.On3.I2wTr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4047 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Andrej Borsenkow" wrote: > In my /etc/zprofile I source /etc/profile. Unfortunately, it contains code > depending of shell (that is, case $0 in -sh | -ksh ...). I don't want to > mess up with system /etc/profile, so I tried to find a way to set $0 only > for the time of sourcing. Currently I use (zsh-3.1.4): I don't think you even need to make it local, since $0 is handled similarly to the other positional arguments. % fn() { 0=foo; echo $0; } % fn foo % echo $0 zsh This fact should probably be construed as a genuine feature. If you're asking, is some bright spark going to decide that $0 should be different from $1 to $infinity and break it, I can't answer that, but it won't be me. -- Peter Stephenson Tel: +39 50 844536 WWW: http://www.ifh.de/~pws/ Gruppo Teorico, Dipartimento di Fisica Piazza Torricelli 2, 56100 Pisa, Italy