Sujet : Re: When/why does the shell (bash) (sometimes) not re-cycle job IDs?
De : naddy (at) *nospam* mips.inka.de (Christian Weisgerber)
Groupes : comp.unix.shellDate : 13. May 2024, 11:42:08
Autres entêtes
Message-ID : <slrnv43rk0.2sq1.naddy@lorvorc.mips.inka.de>
References : 1 2 3 4 5
User-Agent : slrn/1.0.3 (FreeBSD)
On 2024-05-12, Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
Job numbers are reused after it has notified you of termination of the
previous job. At least in Bash.
Demonstrably false:
>
Works for me:
>
ldo@theon:~> sleep 10 &
[1] 1094669
ldo@theon:~> sleep 1 &
[2] 1094670
ldo@theon:~>
[2]+ Done sleep 1
ldo@theon:~> sleep 1 &
[2] 1094671
So if the highest numbered job terminates, that number is immediately
reused. Earlier ones are not.
It's a stack.
And again, that behavior is already present in csh.
-- Christian "naddy" Weisgerber naddy@mips.inka.de