Re: shell
- From: Geoff Clare <geoff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 13:54:09 +0100
Stephane Chazelas <stephane_chazelas@xxxxxxxx> wrote, on Fri, 24 Mar 2006:
On Fri, 24 Mar 2006 14:07:56 +0000, Geoff Clare wrote:
[...]
command -p env -i PATH=/undef /usr/xpg4/bin/sh -c '
command -p getconf PATH'
As far as the standard is concerned, the behaviour is undefined.
Utilities are only required to behave as described in the standard
if they are executed in a "conforming environment" (which includes
which environment variables are set among other things).
So, how do you force a XPG4 or XPG6 "conforming environment" in
a portable way? (based on a "case `uname`"?).
There is no portable way to set up a conforming environment from
a non-conforming one. (Nor could there ever be, if you think about
it, as the standards cannot place any constraint on the behaviour
of non-conforming environments).
The suggested method (not yet implemented) in the link you
refered to:
env -i $(getconf V6_ENV) $(getconf PATH) command
(I suppose they mean
env -i -- $(getconf V6_ENV) "PATH=$(getconf PATH)" command
Environment variable names can't begin with dash, so the "--" is
unnecessary. You are right about PATH.
Doesn't seem to work. First, there are issues with the current
value of IFS and globbing, and the second getconf will not be
run in a "conforming environment", so PATH may not be correct,
and it clears my environment, that's not what I want.
This is not a way of setting up a conforming environment, it is
a way of ensuring that enough of a current conforming environment
is inherited by commands started with "env -i" for them also to
be executing in a conforming environment.
(Point taken about IFS and globbing.)
--
Geoff Clare <netnews@xxxxxxxxxxxxx>
.
- Follow-Ups:
- Re: shell
- From: Stephane Chazelas
- Re: shell
- References:
- Prev by Date: multipath routing source code
- Next by Date: Re: cron + cygwin
- Previous by thread: Re: shell
- Next by thread: Re: shell
- Index(es):
Relevant Pages
|