Re: Call for input on comp.unix.shell FAQ

From: Stephane CHAZELAS (stephane_chazelas_at_yahoo.fr)
Date: 07/17/03


Date: 16 Jul 2003 22:17:04 GMT

Michael Wang wrote:
[...]
>>>> SHELL=/prefered/shell export SHELL
>>>> exec "$SHELL"
[...]
> Why should export be needed in the first place?

SHELL needs to be in the environment. It's likely to already be
in the environment (put there by login), but note that some
shells don't update the environment variable each time the
*shell* variable is modified.

With some shells:

SHELL=/bin/sh
export SHELL
env | grep '^SHELL='
SHELL=/bin/zsh
env | grep '^SHELL='
export SHELL
env | grep '^SHELL='

will output:

/bin/sh
/bin/sh
/bin/zsh

-- 
Stéphane


Relevant Pages

  • Re: Problem wih characters (was Problem with IME)
    ... even *heard* of an "env" utility. ... LANG=ja_JP.UTF-8 environment, although I suspect it wouldn't have any ... When I tried running it in a shell, ... But I am going to study Tobias Diedrich's suggestion very hard. ...
    (sci.lang.japan)
  • Re: Environment variable not remembered outside a script?
    ... After executing the two files (.zshrc is already executed when I opened the ... This is a difference between running a script and sourcing it. ... and any environment variables it sets are ... themselves are not a shell feature but are actually part of the UNIX ...
    (comp.unix.shell)
  • Re: Process Understanding
    ... their environment, especially env variables. ... the that one user has a bash shell while the other has no shell ... The environment variables are read by software commands. ... Now when you execute the source command again, ...
    (Fedora)
  • Re: Export command
    ... exporting a shell variable means marking that shell variable as ... The environment on Unix is a list of strings passed from command ...
    (comp.unix.shell)
  • Re: How can I set an environment variable of the current shell?
    ... your shell just keeps its own list of variable/value pairs and puts ... the exported ones into the environment of spawned child processes. ... to do putenvwhereas shell language designers seem to have not done ... one long-running command locks one file, ...
    (comp.unix.aix)