[R] Turning control back over to the terminal

Ross Boylan ross at biostat.ucsf.edu
Mon Feb 13 23:26:54 CET 2006


I'm invoking R from withing a shell script like this
R --no-save --no-restore --gui=none > `hostname`  2>&1 <<BYE
# various commands here
BYE

I would like to regain control from the invoking terminal at some point.
I tried source(stdin()) but got a syntax error, presumably stdin is the
little shell here snippet (the part between <<BYE
and BYE).

Is there some way to accomplish this?  I am trying to regain control
inside an R session that has been launched inside an MPI environment
(and I'm usually running inside emacs).  This is on a Mac OS X cluster.

I suppose there might be a way to do this with expect, but I'm hoping
for something simpler.  Potentially, I could make the script itself act
differently on the head node (the only one I want to debug right now),
including changing the redirection there.


-- 
Ross Boylan                                      wk:  (415) 514-8146
185 Berry St #5700                               ross at biostat.ucsf.edu
Dept of Epidemiology and Biostatistics           fax: (415) 514-8150
University of California, San Francisco
San Francisco, CA 94107-1739                     hm:  (415) 550-1062




More information about the R-help mailing list