On Sat, Feb 6, 2016 at 10:41 AM, Brett Neumeier <bneume...@gmail.com> 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
Cheers!
-Colin


-- 
"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

Reply via email to