zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Cc: "Andrej Borsenkow" <borsenkow.msk@sni.de>
Subject: Re: sourcing of /etc/profile with $0 == -sh
Date: Fri, 05 Jun 1998 09:39:55 +0200	[thread overview]
Message-ID: <199806050739.JAA27113@hydra.ifh.de> (raw)
In-Reply-To: ""Andrej Borsenkow""'s message of "Fri, 05 Jun 1998 10:36:41 MST." <003801bd904c$4df7c680$21c9ca95@ao13.mow.sni.de>

"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@ifh.de>       Tel: +39 50 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy


       reply	other threads:[~1998-06-05  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <003801bd904c$4df7c680$21c9ca95@ao13.mow.sni.de>
1998-06-05  7:39 ` Peter Stephenson [this message]
1998-06-05  8:22   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199806050739.JAA27113@hydra.ifh.de \
    --to=pws@ifh.de \
    --cc=borsenkow.msk@sni.de \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).