www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/19/10:03:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <F76C9B2DA2FC4C4CA0A18E288BBCBCF7082177EC@nihexchange24.nih.gov>
From: "Buchbinder, Barry (NIH/NIAID)" <BBuchbinder AT niaid DOT nih DOT gov>
To: "'Thomas L Roche'" <tlroche AT us DOT ibm DOT com>, cygwin AT cygwin DOT com
Subject: RE: [OT?] make bash script wait for called program to finish?
Date: Mon, 19 Apr 2004 10:03:00 -0400
MIME-Version: 1.0
X-IsSubscribed: yes

Actually, there may be a simpler way than cmd /c start /wait
program_being_waited_for

/c/tmp> cat t
#!/bin/sh
date
/c/windows/notepad
date
/c/tmp> t
Mon Apr 19 09:51:35 EDT 2004
Mon Apr 19 09:51:47 EDT 2004
1 /c/tmp>

Ditto with #!/bin/bash.

So (at least on XP) if you just start the program without using cygstart or
putting it in the background with &, the shell just waits for it to finish.

-----Original Message-----
From: Thomas L Roche [mailto:tlroche AT us DOT ibm DOT com] 
Sent: Sunday, April 18, 2004 8:01 PM
To: cygwin AT cygwin DOT com
Subject: Re: [OT?] make bash script wait for called program to finish?


Tom Roche Sunday, April 18, 2004 6:20 PM
>>> what I'd like my script to do is

>>> 0 wget

>>> 1 launch the extractor UI, which I will briefly twiddle

>>> 2 wait for the extractor to finish

>>> 3 check that the installer and images were created

>>> 4 run the installer on the images

>>> I know how to script everything but 2

Barry Buchbinder Sun, 18 Apr 2004 18:56:47 -0400
>> How about the following?
>> $ cmd /c start /wait program_being_waited_for

Thanks! I've never run windows' shell from bash, but that does the
job.

Larry Hall Sun, 18 Apr 2004 19:12:03 -0400
> Should we assume that 'wait' didn't work for you?

I didn't try that: doesn't 'wait' just wait for the given period
(arg=n)? If so, that would be at best a kludge.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019