This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [OT?] make bash script wait for called program to finish?


I was actually surprised that bash stopped when I did the experiment.

It wouldn't surprise me if it would depend on which program one was trying
to wait for, in addition to which version of windows.  MS products do so
much behind one's back -- making life easier for the novice but more
difficult if one half-knows what one is doing -- that it is difficult to
rely on consistency.

If you are working in a mixed cmd.exe/command.com environment, you might
want to try one of the following

/c/tmp> $(cygpath -u "${COMSPEC}") /c start /wait /program_to_wait_for

or

/c/tmp> eval $(cygpath -u "${COMSPEC}") /c start /wait /program_to_wait_for

(I've yet to figure out when eval is appropriate, but both seem to work
here, at least for me.)

Or use command.com instead of cmd.exe -- I think all system have it.  (At
least XP Pro does.)

-----Original Message-----
From: Thomas L Roche [mailto:tlroche@us.ibm.com] 
Sent: Monday, April 19, 2004 10:36 AM
To: cygwin@cygwin.com
Subject: RE: [OT?] make bash script wait for called program to finish?


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

Tom Roche Sunday, April 18, 2004 8:01 PM
>>> I've never run windows' shell from bash, but that does the job.

Larry Hall 04/18/2004 07:12 PM
>> [For 'wait n',] 'n' is a proc id.  See 'man bash'.

arrgghh: I tried "{info, man} wait".

Buchbinder, Barry 04/19/2004 10:03:00 AM:
> (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.

I'm not sure if the problem is that

* I'm on 2k

* the program being run is java-based

but bash does not stop.


--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]