Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sourcing of /etc/profile with $0 == -sh
- X-seq: zsh-workers 4047
- From: Peter Stephenson <pws@xxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (Zsh hackers list)
- Subject: Re: sourcing of /etc/profile with $0 == -sh
- Date: Fri, 05 Jun 1998 09:39:55 +0200
- Cc: "Andrej Borsenkow" <borsenkow.msk@xxxxxx>
- In-reply-to: ""Andrej Borsenkow""'s message of "Fri, 05 Jun 1998 10:36:41 MST." <003801bd904c$4df7c680$21c9ca95@xxxxxxxxxxxxxxx>
"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 <pws@xxxxxx> Tel: +39 50 844536
WWW: http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy
Messages sorted by:
Reverse Date,
Date,
Thread,
Author