Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SHELL not always correct
- X-seq: zsh-users 13366
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: Aaron Davies <aaron.davies@xxxxxxxxx>
- Subject: Re: SHELL not always correct
- Date: Tue, 21 Oct 2008 18:02:38 -0700
- Cc: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, dqarras@xxxxxxxxx, ZSH Users <zsh-users@xxxxxxxxxx>, pws@xxxxxxxxxxxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=d200807; d=spodhuis.org; h=Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=D7kqj0dXD+lIYdeJva7+mMunxGQk4EJPnhMxENmxCnlDc4FwdH6+wyCCzknpbHwardL+OwYBhpmhp5p13V88p5OvmNcBqBzgEfHSWB17UL/G+X16xH8K85AkLixUhPpeyDwcE0WiyQovuQsaiZfjPpnTr/P0/X7L4x6N9uwdYVc=;
- In-reply-to: <c4e763ac0810211735r515d8c19ja4f7d6d338fd9e10@xxxxxxxxxxxxxx>
- Mail-followup-to: Aaron Davies <aaron.davies@xxxxxxxxx>, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, dqarras@xxxxxxxxx, ZSH Users <zsh-users@xxxxxxxxxx>, pws@xxxxxxxxxxxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <903527.44182.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <200810212058.m9LKwXQe009278@xxxxxxxxxxxxxxxxxxx> <20081021231323.GA89901@xxxxxxxxxxxxxxxxxxxx> <c4e763ac0810211735r515d8c19ja4f7d6d338fd9e10@xxxxxxxxxxxxxx>
On 2008-10-22 at 08:35 +0800, Aaron Davies wrote:
> On Wed, Oct 22, 2008 at 7:13 AM, Phil Pennock
> <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
>
> > Seems rather presumptuous, to claim to child processes that you are the
> > user's chosen preferred shell, merely because you're running.
>
> I've generally found that SHELL isn't much use for figuring out what you're in.
Never has been. Used to be that $0 was a good check and if $0 was unset
then you're in csh. Nowadays with /bin/sh being a symlink to some other
shell and sometimes needing to figure out what /bin/sh is that's more
interesting.
But anyone thinking $SHELL is the current shell is misunderstanding;
$SHELL is a statement of desired intent, not of current state. It can
be set by something conveying desired intent (ie, it looked in system
databases such as /etc/passwd), by the user themselves or by someone
needing to override desired intent for a process sub-tree, but shouldn't
be being set by a shell for its children just because it's running.
This actually appears to be a bash bug, as it means that on systems
where /bin/sh is bash, programs using popen()/system()/etc will lose
information about the user's configuration and even if zsh is the shell
in /etc/passwd, programs run via such a path won't see it. Unless bash
only calls this logic for interactive shells, that is. Figuring that
out would involve reading enough of the bash source that someone might
object to the reader then contributing to a non-GPL shell such as zsh.
:-(
I don't believe I currently have access to any systems using bash as
/bin/sh to test the actual behaviour; they're all either using BSD sh or
dash or equivalent. Or in a production environment where I really am
not going to run private tests.
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author