[olug] Bash or CygWin quirk waiting for process...

Dan Linder dan at linder.org
Thu Jun 29 17:25:02 CDT 2017


I'm using CygWin in Windows 10 to automate a process.  I have two child
shell scripts I want to kick off from my main script, but I want the main
script to hang around until both of the child scripts are done.

The two child scripts are called as processes of "mintty" so the output of
each is in separate windows.

Here's my script:

#!/bin/bash
mintty -t Type-A --exec ./build.sh typeA &
mintty -t Type-B --exec ./build.sh typeB &

for job in `jobs -p` ; do
  echo Waiting for child $job of jobs: `jobs -p` to exit.
  wait $job
done

./process_both.sh


Both of the MinTTY consoles open and run the script, but the wait for-loop
doesn't wait and the "process_both.sh" script fires right away.

Any ideas?

Dan


-- 
***************** ************* *********** ******* ***** *** **
"If you wish to make an apple pie from scratch,
  you must first invent the universe."
  -- Carl Sagan

"Quis custodiet ipsos custodes?"
    (Who can watch the watchmen?)
    -- from the Satires of Juvenal

"I do not fear computers, I fear the lack of them."
    -- Isaac Asimov (Author)
** *** ***** ******* *********** ************* *****************


More information about the OLUG mailing list