Re: [R] system() command in R

2011-04-10 Thread rasanpreet kaur suri
Thank you all for the suggestions. I've been trying different things to make
this work.

Mike I did try what you suggested . It would work normally But i guess here
the problem is my local server itself. It by default takes time to start and
nothing I do is helping . So I came up with the idea to communicate with the
server through R-java connection.
I am halfway through that , I hope it works:)

Thank you all for the response.

On Tue, Apr 5, 2011 at 4:36 PM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote:

 The ampersand is a good idea, but nohup is best avoided in scripts. Rather
 the server itself should handle the transition to daemon status to avoid
 ending up with many duplicate server processes running.
 ---
 Jeff Newmiller The . . Go Live...
 DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go...
 Live: OO#.. Dead: OO#.. Playing
 Research Engineer (Solar/Batteries O.O#. #.O#. with
 /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
 ---

 Sent from my phone. Please excuse my brevity.

 Mike Marchywka marchy...@hotmail.com wrote:

 --
  Date: Tue, 5 Apr 2011 13:37:12 +0530
  From: nandan.a...@gmail.com
  To: rasanpreet.k...@gmail.com
  CC: r-help@r-project.org
  Subject: Re: [R] system() command in R
 
  On 4 April 2011 16:54, rasanpreet kaur suri wrote:
 
   Hi all,
   I have a local server insalled on my system and have to start that from
   within my R function.
  
   here is how I start it:
  
   cmd-sh start-server.sh
  
   system(cmd, wait=FALSE)
  
   My function has to start the server and proceed with further steps. The
   server starts but the further steps of the program are not executed.The
   cursor keeps waiting after the server is started.
  
   How r u executing further steps after starting server, meant for server
  from R ??
 
 
  i tried removing the wait=FALSE, but it still keeps waiting.
  
   I also tried putting the start-server in a separate function and my 
   further
   script in a separate function and then run them together, but it still
   waits. The transition from the start of server to next step is not
   happening.
  
   Please help. I have been stuck on this for quite some time now.
  
   --

 I hadn't done this in R but expect to do so soon.
 I just got done with some java code to do something similar and you can 
 expect in any implementation these things will be  system dependent. It 
 often helps to have simple test cases to isolate the problem. Here I made a 
 tst script called foo
 that takes a minute or so to exevute and generates some output.

 If I type
 system(./foo,wait=F)
  the prompt comes back right away but stdout seems to still go to my console 
 and maybe stdin is not redicrected either and it could eat your input ( no 
 idea, but this is probably not what you want).

 I did try this that could fix your problem, on debian anyway it seems to 
 work,

 system(nohup ./foo )
  you can man nohup for details.

   Rasanpreet Kaur
  
   [[alternative HTML version deleted]]
  
  
 --
   R-help@r-project.org mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide
   http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.
  
 
 
 
  --
  Amar Kumar Nandan
  Karnataka, India, 560100
  http://aknandan.co.nr
 
  [[alternative HTML version deleted]]
 
 
 --
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide 
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 --
 R-help@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
 and provide commented, minimal, self-contained, reproducible code.




-- 
Rasanpreet Kaur

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system() command in R

2011-04-05 Thread nandan amar
On 4 April 2011 16:54, rasanpreet kaur suri rasanpreet.k...@gmail.comwrote:

 Hi all,
 I have a local server insalled on my system and have to start that from
 within my R function.

 here is how I start it:

 cmd-sh start-server.sh

 system(cmd, wait=FALSE)

 My function has to start the server and proceed with further steps. The
 server starts but the further steps of the program are not executed.The
 cursor keeps waiting after the server is started.

 How r u executing further steps after starting server, meant for server
from R  ??


i tried removing the wait=FALSE, but it still keeps waiting.

 I also tried putting the start-server in a separate function and my further
 script in a separate function and then run them together, but it still
 waits. The transition from the start of server to next step is not
 happening.

 Please help. I have been stuck on this for quite some time now.

 --
 Rasanpreet Kaur

[[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Amar Kumar Nandan
Karnataka, India, 560100
http://aknandan.co.nr

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system() command in R

2011-04-05 Thread rasanpreet kaur suri
Hi,
 The further steps do not get executed because the server keeps
waiting. and they are in the same function as the start server.

if server started manually then they run normally from the R environment. Is
that what you wanted to know?  I hope I answered it .



On Tue, Apr 5, 2011 at 10:07 AM, nandan amar nandan.a...@gmail.com wrote:



 On 4 April 2011 16:54, rasanpreet kaur suri rasanpreet.k...@gmail.comwrote:

 Hi all,
 I have a local server insalled on my system and have to start that from
 within my R function.

 here is how I start it:

 cmd-sh start-server.sh

 system(cmd, wait=FALSE)

 My function has to start the server and proceed with further steps. The
 server starts but the further steps of the program are not executed.The
 cursor keeps waiting after the server is started.

 How r u executing further steps after starting server, meant for server
 from R  ??


 i tried removing the wait=FALSE, but it still keeps waiting.

 I also tried putting the start-server in a separate function and my
 further
 script in a separate function and then run them together, but it still
 waits. The transition from the start of server to next step is not
 happening.

 Please help. I have been stuck on this for quite some time now.

 --
 Rasanpreet Kaur

[[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




 --
 Amar Kumar Nandan
 Karnataka, India, 560100
 http://aknandan.co.nr




-- 
Rasanpreet Kaur

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system() command in R

2011-04-05 Thread Mike Marchywka












 Date: Tue, 5 Apr 2011 13:37:12 +0530
 From: nandan.a...@gmail.com
 To: rasanpreet.k...@gmail.com
 CC: r-help@r-project.org
 Subject: Re: [R] system() command in R

 On 4 April 2011 16:54, rasanpreet kaur suri wrote:

  Hi all,
  I have a local server insalled on my system and have to start that from
  within my R function.
 
  here is how I start it:
 
  cmd-sh start-server.sh
 
  system(cmd, wait=FALSE)
 
  My function has to start the server and proceed with further steps. The
  server starts but the further steps of the program are not executed.The
  cursor keeps waiting after the server is started.
 
  How r u executing further steps after starting server, meant for server
 from R ??


 i tried removing the wait=FALSE, but it still keeps waiting.
 
  I also tried putting the start-server in a separate function and my further
  script in a separate function and then run them together, but it still
  waits. The transition from the start of server to next step is not
  happening.
 
  Please help. I have been stuck on this for quite some time now.
 
  --

I hadn't done this in R but expect to do so soon.
I just got done with some java code to do something similar
and you can expect in any implementation these things will be 
system dependent. It often helps to have simple test cases
to isolate the problem. Here I made a tst script called foo
that takes a minute or so to exevute and generates some output.

If I type
system(./foo,wait=F) 

the prompt comes back right away but stdout seems to still
go to my console and maybe stdin is not redicrected either
and it could eat your input ( no idea, but this is probably not what you
want).

I did try this that could fix your problem, on debian anyway
it seems to work,

system(nohup ./foo )

you can man nohup for details. 














  Rasanpreet Kaur
 
  [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 



 --
 Amar Kumar Nandan
 Karnataka, India, 560100
 http://aknandan.co.nr

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
  
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system() command in R

2011-04-05 Thread Jeff Newmiller
The ampersand is a good idea, but nohup is best avoided in scripts. Rather the 
server itself should handle the transition to daemon status to avoid ending up 
with many duplicate server processes running.
---
Jeff Newmiller The . . Go Live...
DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

Mike Marchywka marchy...@hotmail.com wrote:

_
 Date: Tue, 5 Apr 2011 13:37:12 +0530  From: nandan.a...@gmail.com  To: 
 rasanpreet.k...@gmail.com  CC: r-help@r-project.org  Subject: Re: [R] 
 system() command in R   On 4 April 2011 16:54, rasanpreet kaur suri wrote: 
Hi all,   I have a local server insalled on my system and have to 
 start that from   within my R function. here is how I start it:   
   cmd-sh start-server.sh system(cmd, wait=FALSE) My 
 function has to start the server and proceed with further steps. The   
 server starts but the further steps of the program are not executed.The   
 cursor keeps waiting after the server is started. How r u executing 
 further steps after starting server, meant for server  from R ??i 
 tried removing the wait=FALSE, but it still keeps waiting. I also 
 tried putting the start-server in a separate function and my further   
 script in a separate function and then run them together, but it still   
 waits. The transitio
 n from
the start of server to next step is not   happening. Please help. I 
have been stuck on this for quite some time now. -- I hadn't done this 
in R but expect to do so soon. I just got done with some java code to do 
something similar and you can expect in any implementation these things will be 
system dependent. It often helps to have simple test cases to isolate the 
problem. Here I made a tst script called foo that takes a minute or so to 
exevute and generates some output. If I type system(./foo,wait=F) the prompt 
comes back right away but stdout seems to still go to my console and maybe 
stdin is not redicrected either and it could eat your input ( no idea, but this 
is probably not what you want). I did try this that could fix your problem, on 
debian anyway it seems to work, system(nohup ./foo ) you can man nohup for 
details.   Rasanpreet Kaur [[alternative HTML version deleted]]
_
  R-help@r-project.org mailing list   
  https://stat.ethz.ch/mailman/listinfo/r-help   PLEASE do read the posting 
  guide   http://www.R-project.org/posting-guide.html   and provide 
  commented, minimal, self-contained, reproducible code.   --  
  Amar Kumar Nandan  Karnataka, India, 560100  http://aknandan.co.nr   
  [[alternative HTML version deleted]]  
  _
 R-help@r-project.org mailing list  
 https://stat.ethz.ch/mailman/listinfo/r-help  PLEASE do read the posting 
 guide http://www.R-project.org/posting-guide.html  and provide commented, 
 minimal, self-contained, reproducible 
 code._
R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code. 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] system() command in R

2011-04-04 Thread rasanpreet kaur suri
Hi all,
I have a local server insalled on my system and have to start that from
within my R function.

here is how I start it:

cmd-sh start-server.sh

system(cmd, wait=FALSE)

My function has to start the server and proceed with further steps. The
server starts but the further steps of the program are not executed.The
cursor keeps waiting after the server is started.

i tried removing the wait=FALSE, but it still keeps waiting.

I also tried putting the start-server in a separate function and my further
script in a separate function and then run them together, but it still
waits. The transition from the start of server to next step is not
happening.

Please help. I have been stuck on this for quite some time now.

-- 
Rasanpreet Kaur

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.