This is the mail archive of the
mailing list for the Cygwin project.
Re: running a DOS batch file from a shell script - script doesn't wait for batch file to complete before continuing
- From: Larry Hall <lh-no-personal-replies-please at cygwin dot com>
- To: Andy Sun <asun at sayeh dot ca>, cygwin at cygwin dot com
- Date: Thu, 09 Dec 2004 22:26:15 -0500
- Subject: Re: running a DOS batch file from a shell script - script doesn't wait for batch file to complete before continuing
- References: <email@example.com>
- Reply-to: Cygwin List <cygwin at cygwin dot com>
At 09:55 PM 12/9/2004, you wrote:
>I have a shell script (#!/bin/sh) that runs a DOS batch file. During the execution of the shell script,
>it runs the DOS batch file (Pro/ENGINEER's PRO_BATCH.BAT to generate a plot file) but the
>script does not appear to wait for the DOS batch file to finish first before continuing.
>I tried running the DOS batch file using another shell (/bin/sh -c file.bat) within the script,
>use "wait" right after the batch file line to wait for the process to complete first but none of
>them seem to work. I've also searched the web for answers with no avail. It looks like
>once the DOS batch file starts to execute, it is not possible to exercise job control on the
>cygwin unix side. The versions of my Cygwin and Windows are:
>Cygwin version: CYGWIN_NT-5.1 1.5.9 (0.112/4/2)
>OS version: Windows XP Professional Version 2002 w/ Service Pack 1
The following worked fine for me:
This is with the latest Cygwin (1.5.12) and W2K.
The version of Pro/E is a bit out of date but it still popped up the GUI
and sat there waiting for me to do something. The shell script didn't
exit until I terminated the program/bat file.
Larry Hall http://www.rfk.com
RFK Partners, Inc. (508) 893-9779 - RFK Office
838 Washington Street (508) 893-9889 - FAX
Holliston, MA 01746
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html