[R-SIG-Mac] user environment not respected by GUI

joerg van den hoff j.van_den_hoff at fz-rossendorf.de
Thu Dec 23 12:24:23 CET 2004


Byron Ellis wrote:
> This isn't actually a problem in R, its due to the fact that 
> LaunchService doesn't launch apps through a shell so your profile never 
> gets sourced. Instead it gets the environment from the Environment.plist 
> file.
> 
> More info here: http://developer.apple.com/qa/qa2001/qa1067.html
> 
> 
> On Dec 23, 2004, at 12:42 AM, joerg van den hoff wrote:
> 
>>
>> only a tiny problem:
>> the search path for system (unix) commands in the GUI differs from the 
>> path of the user, as I noted when trying to generate a file list for 
>> further processing with something like
>>
>> R> flist <- system("locate *.dat",intern=T)
>>
>> that works fine (even without protecting the `*'...), problem was, 
>> that the command uses obviously /usr/bin/locate, despite the fact that 
>> in my user search path /sw/bin/locate is found before /usr/bin/locate 
>> (and uses a different default database). I have now simply specified 
>> the absolute path but it would be nicer to have consistent search 
>> paths for system commands (I possibly would'nt have noticed, if the 
>> other locate database would have contained older versions of equally 
>> named data files (with possibly obsolete content) and _that_ could 
>> cause trouble).
>>
>> so, within the GUI I get
>>
>> R> system('echo $PATH')
>> /usr/bin:/bin:/usr/sbin:/sbin:/Users/vdh:/usr/local/bin
>>
>> i.e. $HOME/.profile (or in my case .cshrc) are bypassed.
>>
>> question: where is the search path set for the GUI? can I change it?
>>
>> regards,
>> joerg
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
> ---
> Byron Ellis (ellis at stat.harvard.edu)
> "Oook" -- The Librarian
> 
> 
thanks for the response.

obviously 'off list', but maybe some others have the same problem in
connection with using R on the Mac:


I  generated the ~/.MacOSX/environment.plist file as described under
http://developer.apple.com/qa/qa2001/qa1067.html and the entry

<dict>
         <key>PATH</key>
         <string>/sw/bin:/sw/sbin:.:/soft/bin:/usr/local/bin
/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin</string>
</dict>


(string originally on one line) fixes indeed the search path.

regards,
joerg



More information about the R-SIG-Mac mailing list