[R-SIG-Mac] Failure of CLI with .Rprofile on Mac OS X
    peter dalgaard 
    pdalgd at gmail.com
       
    Sun Sep 21 10:50:41 CEST 2014
    
    
  
On 21 Sep 2014, at 01:25 , David Winsemius <dwinsemius at comcast.net> wrote:
> 
> Peter;
> 
> Do you know whether the "PWD" value in the result from  Sys.getenv() is supposed to point at the working directory of R started from the command line?
> 
> -- 
> David.
> 
Yes, that's standard Unix shell behavior:
Peter-Dalgaards-MacBook-Air:~ pd$ cd r-devel/BUILD 
Peter-Dalgaards-MacBook-Air:BUILD pd$ echo $PWD
/Users/pd/r-devel/BUILD
I.e. it is done by the shell, R just inherits it. Notice that it is just a variable tracking the result of 'cd'. You can set it, but that doesn't actually do anything, except for things that use the PWD variable directly, like the shell prompt
Peter-Dalgaards-MacBook-Air:BUILD pd$ export PWD=/foo/bar
Peter-Dalgaards-MacBook-Air:bar pd$ pwd
/Users/pd/r-devel/BUILD
-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com
    
    
More information about the R-SIG-Mac
mailing list