trying to get the process id for a spawned process to wait for it
C. Woody Butler
charles.butlerjr@constellation.com
Wed May 18 18:06:00 GMT 2011
Ryan Johnson <ryanjohn <at> ece.cmu.edu> writes:
>
> What shell are you using? In bash, at least, the above won't work -- you
> want Jobs=((Jobs+1))
>
> Just to be sure, you've confirmed that the problem arises because the
> if-then body runs with an empty $PID? Do the two echo commands fire?
>
> Ryan
>
>
bash
the $Jobs thing works fine (surprised me actually
but I went with it - I'm not a beginner programmer
but I'm fairly new to BASH scripting, and this was my
first attempt at doing math ).
yes, the echoes fire, and the $PID is blank.
that echo just says "is the process".
BUT --
And I just ran it to make sure I wasn't crazy,
and apparently I was because now it's working
beautifully. And unless the CYGWIN gremlin changed
it it's still the same code I posted.
And it still adds right.
Sooo - thanks. I'm crazy, it works as advertised,
and all's right with the world.
Yay.
--woody
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list