Server $PATH doesn't update during orchestration

Ross Kilgariff's Avatar

Ross Kilgariff

05 Nov, 2015 04:48 PM

Hi,

I'm setting up an orchestration script that installs some binaries on an Ubuntu 14.04 server in a non-standard location and updates the PATH environment variable.

The idea is that the binaries should be runnable in subsequent scripts without having to specify the full path.

The problem I'm seeing is that PATH reverts to its previous value after the first script exits, and even `export PATH=$PATH` doesn't seem to make the new value stick.

Is there anything I can do to make sure scripts correctly pick up the new value of $PATH without modifying every script in the chain?

Thanks,
Ross

  1. Support Staff 1 Posted by Marat Komarov on 10 Nov, 2015 10:54 AM

    Marat Komarov's Avatar

    export PATH=$PATH sets environment only for current process. You need to set environment variables globally, and there are several ways to do it with a different pitfalls. So extending $PATH in each script is not a bad idea though.

  2. Marat Komarov closed this discussion on 22 Dec, 2015 05:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac