bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wait -n -p var assigns a random number to var if there are no jobs


From: Robert Elz
Subject: Re: wait -n -p var assigns a random number to var if there are no jobs
Date: Fri, 11 Dec 2020 21:15:01 +0700

    Date:        Fri, 11 Dec 2020 13:25:01 +0300
    From:        =?UTF-8?B?T8SfdXo=?= <oguzismailuysal@gmail.com>
    Message-ID:  
<CAH7i3LoHFUa4aSF5-AD2r80HG-p-YzD_9ZxomarZkhP8NMq63g@mail.gmail.com>

  | $ wait -n -p var
  | $ echo $var $?
  | 66390280 127
  |
  | If it left `var' unset

That's what the NetBSD sh does with this, it always explicitly unsets
the var given initially, and then sets it to the pid (actually, when
args are given, as in "wait -p var -n 111 222 333 %4" to the arg that
was given which exited, and when there are no args, as in your example,
to the pid).   It is useful, and definitely disambiguates the 127 status
case.

kre




reply via email to

[Prev in Thread] Current Thread [Next in Thread]