This is the mail archive of the
mailing list for the Cygwin project.
Re: Bash returns incorrect process status
- From: luke dot kendall at cisra dot canon dot com dot au
- To: cygwin at cygwin dot com
- Date: Fri, 17 Sep 2004 17:36:17 +1000 (EST)
- Subject: Re: Bash returns incorrect process status
On 16 Sep, Pierre A. Humblet wrote:
> But bash seems to keep at least CHILD_MAX jobs, each one of them possibly
> with many (unbounded) processes. It is very easy to produce situations
> where bash keeps track of thousands of pids. Many of those pids (e.g. the
> first ones in pipelines) will have been waited on, and nothing prevents the
> OS from reusing them. Pid aliasing can easily occur even if the OS never
> reuses a pid in CHILD_MAX consecutive forks from a process.
I'm coming in to this discussion late, and this is probably way off
topic. But I once thought bash wasn't reporting status of the previous
command properly (as reported via $?), when what was really happening
was that I was executing other commands as part of my bash prompt, and
bash was reporting the (successful) status of the last of those
I.e. I'd get a different result by doing:
if [ $? = 0 ]
some-command && ...
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html