Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Is a pristine shell allowed to set HOME? (fwd)
- X-seq: zsh-workers 22194
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Is a pristine shell allowed to set HOME? (fwd)
- Date: Sun, 5 Feb 2006 12:44:40 -0800 (PST)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Reply-to: zsh-workers@xxxxxxxxxx
Zsh seems to be the odd man out, here.
---------- Forwarded message ----------
Date: Sun, 5 Feb 2006 20:14:07 +0100
From: Jens Schweikhardt <schweikh@xxxxxxxxxxxxxxxx>
To: austin-group-l@xxxxxxxxxxxxx
Subject: Is a pristine shell allowed to set HOME?
Resent-Date: 5 Feb 2006 19:15:00 -0000
Resent-From: austin-group-l@xxxxxxxxxxxxx
Resent-To: austin-group-l@xxxxxxxxxxxxx
hello, world\n
I'm currently pondering the question, if a pristine shell, i.e one
started with "env -i /path/to/shell" is allowed to set (initialize)
HOME. 2.5.3 on shell variables states,
HOME
The pathname of the user's home directory. The contents of HOME are
used in tilde expansion (see Tilde Expansion).
For three other variables, the standard explicitly says "set by the shell",
LINENO
Set by the shell to a decimal number...
PPID
Set by the shell to the decimal process ID...
PWD
Set by the shell to be an absolute pathname...
But it does not explicitly say so for HOME. Different shells behave
differently, e.g on FreeBSD
# env -i /bin/sh -c set | grep ^HOME=
# env -i /usr/local/bin/bash -c set | grep ^HOME=
# env -i /usr/local/bin/zsh -c set|grep ^HOME=
HOME=/root
# env -i /usr/local/bin/ksh93 -c set|grep ^HOME=
# env -i /usr/local/bin/pdksh -c set|grep ^HOME=
# env -i /bin/csh -c 'echo $HOME' # = tcsh
HOME: Undefined variable.
Is it okay for a shell to initialize HOME if it does not come in from
the inherited environment?
Regards,
Jens
--
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author