Re: emptyenv and default path

From: Colin Booth <>
Date: Sat, 6 Feb 2016 11:31:09 -0800

On Sat, Feb 6, 2016 at 10:41 AM, Brett Neumeier <> wrote:
> Hi,
> I'm trying to get a handle on execline and have found some behavior that
> perplexes me. I'm hoping someone can clarify what's going on!
You came to the right place!
> If I change the first foreground command (line #1) so that it *also* has a
> full path /opt/skar/bin/foreground, then the script works just as it does
> if /opt/skar/bin is in the PATH when I run the script -- so after emptyenv
> exec's into the next program, the default path is definitely being used.
> Why isn't it used when emptyenv is running?
Due to the mechanism of exec, emptyenv doesn't modify it's
environment, it modifies the environment that the next command
receives. Because of this, emptyenv has a $PATH that it attempts to
find foreground on. Foreground however does not receive a path and so
falls back to using the default.
> Cheers!
> Brett

"If the doors of perception were cleansed every thing would appear to
man as it is, infinite. For man has closed himself up, till he sees
all things thru' narrow chinks of his cavern."
  --  William Blake
Received on Sat Feb 06 2016 - 19:31:09 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC