Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Run the -shell- command in parallel on Unix


From   "Sergiy Radyakin" <[email protected]>
To   <[email protected]>
Subject   st: Re: Run the -shell- command in parallel on Unix
Date   Thu, 12 Apr 2007 19:19:58 +0200

Hi,
are you using a GUI version? If so, winexec is supported (quote from
help winexec):

Stata for ...
command Windows Macintosh Unix(GUI) Unix(console)
-------------------------------------------------------------
shell X X X X
winexec X X X -
xshell - - X - -------------------------------------------------------------


Doesn't "command &" do what you want? See here:
http://www.washington.edu/computing/unix/startdoc/shell.html
(section "Run a Process in the Foreground or the Background")

But if not, one can also implement it. The trick is that Stata waits
for the task to complete, so the task which is launched from Stata
must just pull the trigger, and let the OS to control the process.
In windows we do it with ShellExecuteEx, in Unix with a fork()
function:
http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/node16.html

So, all you need to do is to create a small C-program, which will
receive one parameter (name of the task) -- launch it as a child
process and terminate without waiting. I am sure it exists already,
just need to have a look into the Unix manual. (in Windows it is
called -start-, internal in XP, external in W9x/Me).

Regards,
Sergiy




----- Original Message ----- From: "David Hadley" <[email protected]>
To: <[email protected]>
Sent: Thursday, April 12, 2007 4:04 PM
Subject: st: Run the -shell- command in parallel on Unix



I'm wondering if there is a way in Unix to effectively run the -winexec-
command? That is, to have the -shell- command work in parallel to the
Stata process that it was spawned from.

Thanks in advance,
Dave

David Hadley
Division of Community Health Sciences
St George's, University of London
Tel: 020 8725 1312
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index