R.app and JGR.app and the PATH environmental variable
It depends on what is the parent process. If you use terminal, bash is the parent process, which honors environmental variables in .bashrc or /etc/profile. If you launch the app in Finder, which does care about .bashrc, you do not get the environmental variables set there. Instead, you should edit ~/.MacOSX/environment.plist (see http://developer.apple.com/library/mac/#qa/qa2001/qa1067.html). Best, Michael
On Thu, Mar 3, 2011 at 3:16 PM, Ian Fellows <ian.fellows at stat.ucla.edu> wrote:
Hi All, I'm observing some behavior in R.app that I can't quite figure out. In the terminal and R run from the terminal I get the following for my PATH
Sys.getenv("PATH")
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PATH "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin"
q("no")
Ian-Fellowss-MacBook-Pro:~ ianfellows$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin However, in R.app I get:
Sys.getenv("PATH")
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PATH "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" While in JGR-SL.app I get:
Sys.getenv("PATH")
? ? ? ? ? ? ? ? ? ? ? ? ? PATH "/usr/bin:/bin:/usr/sbin:/sbin" Finally if I start JGR from the terminal Ian-Fellowss-MacBook-Pro:~ ianfellows$ ./JGR-SL.app/Contents/MacOS/JGR when JGR opens, the PATH is correct:
Sys.getenv("PATH")
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?PATH "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin" Does anyone have any thoughts as to what is going on here. Thanks, Ian
_______________________________________________ R-SIG-Mac mailing list R-SIG-Mac at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-mac