On Thu, 2009-11-12 at 10:04 -0800, Cathey, Jim wrote:
> >how one can clear current environment within a shell script?
> 
> Pity something like:
> 
>       env - (
>               rest of script here
>       )
> 
> doesn't seem to work!
"env" is /usr/bin/env and/or /bin/env (and can't remember of any
host/shell where it was different).
So you could at most change the environment of the process running "env"
from within "env" (and you really do not want any other possibility.
Consider the implications if process $X can change the environment of
process $Y - even is UID/GID match and they have some relationship like
"same process group" or "ancestor" or so).

So you need some funny command line made of (mostly) shell-builtins
(which makes such command lines shell-dependent) or use `eval` (similar
to the standard way with e.g. `dircolors`).

        Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to