I am trying to run bash commands from within Mathematica. Funnily enough, Mathematica seems to use a different $PATH environment than the system environment. If I try
or equivalently in Mathematica 10
RunProcess[$SystemShell, All, "echo $PATH"]
I get (in StandardOutput):
However, if I run
echo $PATH on my (OS X) terminal, I get (both as user and root):
which is indeed the full path. Why doesn't use Mathematica the same environmental variable? Is this expected behaviour?
I already mentioned in the comments why this question is different from this one, but to avoid getting this question marked as a duplicate I'll repeat it here.
That thread does not deal with system environment variables (it's an unfortunate wording in the topic title) but with Mathematica environment variables. The path variable for the latter is stored in
$Path in Mathematica, while the former can be accessed by executing
Environment["PATH"] (which gives the OS system environment path). I'm really asking about the system environment variable here, but thanks to ilian and m_goldberg I realise now that it is an OS X issue.