Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SHELL not always correct
- X-seq: zsh-users 13371
- From: Chet Ramey <chet.ramey@xxxxxxxxx>
- To: dqarras@xxxxxxxxx, zsh-workers+phil.pennock@xxxxxxxxxxxx
- Subject: Re: SHELL not always correct
- Date: Tue, 21 Oct 2008 22:31:16 -0400
- Cc: ZSH Users <zsh-users@xxxxxxxxxx>, pws@xxxxxxxxxxxxxxxxxxx, chet.ramey@xxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:reply-to :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:from; bh=xwM1iPNVIbZHMGQ91t17/+fRnfVJWpcRfGPxVs0inSU=; b=xiM9mN2mA9TBPFquLmhxSfh9WotoBd5/tfUB/ywhKYNPaTq69ZD93o4FI1I2s0XMrg MI929/mEnuQWA8WqFEYdokGa0bxM9EGKTuKtdeIt6mFEHheMx8crkV3m7Y212UpSa6M2 ZIDWJVz2anjtyToaOd/raKSSwfeEpCbN7ALHA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:reply-to:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:from; b=qj0xW4ir8jjeQY8N4qRVw+PdxFc1EUlchH8Cik4r7EJ1TvcHgZLYl2CUJnsr+ahh88 ivNirFalf5KtUUp4W+E/Ge2L87Da4CABGA7X7eipCobf+D1fs4wt8f3jgzNzg/ed7NhE ql6fyFz1Jc5vZWuFifTHEHoBDNtl9hWcUsuBw=
- In-reply-to: <20081021231323.GA89901@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: ITS, Case Western Reserve University
- References: <903527.44182.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <200810212058.m9LKwXQe009278@xxxxxxxxxxxxxxxxxxx> <20081021231323.GA89901@xxxxxxxxxxxxxxxxxxxx>
- Reply-to: Chet Ramey <chet.ramey@xxxxxxxx>
Phil Pennock wrote:
> I don't want to read the bash source and end up with tainted knowledge
> or whatever the term is, but this seems safe enough:
>
> # cd /usr/ports/shells/bash
> # make extract
> # fgrep -r '"SHELL"' work
> work/bash-3.2/variables.c: temp_var = find_variable ("SHELL");
> work/bash-3.2/variables.c: temp_var = bind_variable ("SHELL", current_user.shell, 0);
> work/bash-3.2/shell.c: set_var_read_only ("SHELL");
>
> Okay, I peeked at variables.c and this comment:
> /* Set $SHELL to the user's login shell if it is not already set. Call
> get_current_user_info if we haven't already fetched the shell. */
> decorates set_shell_var() which forcibly claims SHELL for itself.
>
> Seems rather presumptuous, to claim to child processes that you are the
> user's chosen preferred shell, merely because you're running.
Gee, it sure would be. If only that were happening. Since you
don't want to read the bash source to avoid contaminating yourself,
why are you speculating?
The comment is accurate: the function sets SHELL to the user's login
shell if it's not already set. Bash neither presumes it is the
preferred shell nor overrides a user's intent. It does assume that
the login shell is the appropriate `preferred shell'.
Bash used to auto-export SHELL because programs like tset and make
still depend on its value. If the current version sets the value,
however, it doesn't export it.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU chet@xxxxxxxx http://cnswww.cns.cwru.edu/~chet/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author