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

Boian Berberov (Public) bberberov at gmail.com
Thu Jun 29 18:01:58 CDT 2017


You might have to trim the output of jobs -p.  Mine gives extra info.

Respectfully,

Boian Berberov
_________________________
https://boian.berberov.eu

On 29/06/17 17:25, Dan Linder wrote:
> 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
> 
> 


More information about the OLUG mailing list