Re: shell



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`"?).

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

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.

--
Stephane
.



Relevant Pages

  • Re: shell
    ... command -p getconf PATH' ... As far as the standard is concerned, ... if they are executed in a "conforming environment" (which includes ...
    (comp.unix.questions)
  • Re: shell
    ... The output from "command -p getconf PATH" can vary depending on ... whether you are running it in a conforming environment or not ... a PATH set for SUSv3 it changes it to one set for SUSv2. ...
    (comp.unix.questions)
  • Re: shell
    ... The output from "command -p getconf PATH" can vary depending on ... whether you are running it in a conforming environment or not ... you already have PATH set to find the SUSv3 utilities before ...
    (comp.unix.questions)
  • Re: shell
    ... The output from "command -p getconf PATH" can vary depending on ... whether you are running it in a conforming environment or not ... you only get the SUSv3 PATH out if ...
    (comp.unix.questions)