Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 17 Sep 2004 17:36:17 +1000 (EST) From: luke DOT kendall AT cisra DOT canon DOT com DOT au Subject: Re: Bash returns incorrect process status To: cygwin AT cygwin DOT com In-Reply-To: <3.0.5.32.20040916224329.0082c940@incoming.verizon.net> MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Message-Id: <20040917073617.AE94C84C4D@pessard.research.canon.com.au> 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 commands! I.e. I'd get a different result by doing: some-command if [ $? = 0 ] then ... and doing some-command && ... luke -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/