Under macOS Sierra, at least, where does Mathematica (currently 11.2) get the value of Environment["PATH"]
?
A comment to the accepted answer at Why does Mathematica use a different $PATH than terminal? seems to claim that Mathematica gets that value from ~/.bash_profile
along with /etc/path
and the files in /etc/paths.d
. That is manifestly wrong!
In fact, on my system,
Environment["PATH"]
gives output only:
/usr/bin:/bin:/usr/sbin:/sbin
However, /etc/path
includes the additional path /usr/local/bin
, and /etc/paths.d
includes among others the file TeX
that contains the additional path /Library/TeX/texbin
.
[I do not have any file ~/.bash_profile
, as that would preclude essential use of ~/.profile
, and the latter is where various applications, including MacPorts, append to the path. (My understanding is that if ~/.bash_profile
exists, then at least in Terminal, ~/.profile
would never be read.)
.profile
). Otherwise, it will have the default system value, which isn't affected by.profile
. $\endgroup$wolframscript
command-line executable). $\endgroup$