zsh-workers
 help / color / mirror / code / Atom feed
From: Richard Coleman <coleman@math.gatech.edu>
To: zsh-workers@math.gatech.edu
Subject: Re: zsh not sourcing /etc/profile?
Date: 14 Apr 1997 13:42:44 -0400	[thread overview]
Message-ID: <rcn2r18prf.fsf@redwood.skiles.gatech.edu> (raw)
In-Reply-To: alainc@bnr.ca's message of 14 Apr 1997 14:05:20 GMT

I found this article on comp.unix.shells.  I thought I would
pass it along.

rc

> > I found out it does, yes. However, I did stumble upon some bash sillyness
> > now. One of the admins we have put something similar to the following in
> > /etc/profile:
> > case "$0" in
> >  -bash|-zsh)
> >        do stuff
> >        ;;
> >  ...
> > esac
> 
> > Now, bash seems to expand the $0 to '-bash', whereas zsh expands it to
> > (which I would think is the _correct_ expansion) '/etc/profile'. It's an
> > old bash version we use here (1.14.7(1)), so I assume this is fixed
> > already in newer versions.
> 
> On my system, HP-UX 9.05
> 
> 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.


       reply	other threads:[~1997-04-14 17:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5ifr3t$sub@charm.il.ft.hse.nl>
     [not found] ` <risqi5.8t6.ln@sequeira.powernet.co.uk>
     [not found]   ` <5irn2i$b2p@charm.il.ft.hse.nl>
     [not found]     ` <5itdj0$dc0@bmtlh10.bnr.ca>
1997-04-14 17:42       ` Richard Coleman [this message]
1997-04-14 18:45         ` Zoltan T. Hidvegi
1997-04-14 19:51 Alain Caron
1997-04-14 22:38 ` Zoltan T. Hidvegi

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=rcn2r18prf.fsf@redwood.skiles.gatech.edu \
    --to=coleman@math.gatech.edu \
    --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).