Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 108:22:13 |
Calls: | 290 |
Files: | 905 |
Messages: | 76,683 |
If no job is running, a new job gets 1, otherwise new jobs are numbered consecutively.
I offer no opinion on this, nor on the Plan 9 assertion that job control
is a poor hack and you should just open another window.
I tried it a few times, but could not get back the #1 slot.
Eventually, I exited jobs 2 & 3, and then re-launched ssh somesystem and it came out as job #1, after which I was able to re-construct jobs 2 & 3 and then things were as they should be. But should this hack be necessary?
I’ve often wondered why shells don’t use poll/select-based event loops. Then they can notify you of job termination immediately, instead of
waiting for you to press return.
On Sat, 11 May 2024 22:44:03 -0000 (UTC), Christian Weisgerber wrote:
If no job is running, a new job gets 1, otherwise new jobs are numbered
consecutively.
Job numbers are reused after it has notified you of termination of the previous job. At least in Bash.
I’ve often wondered why shells don’t use poll/select-based event loops. Then they can notify you of job termination immediately, instead of
waiting for you to press return.
I offer no opinion on this, nor on the Plan 9 assertion that job control
is a poor hack and you should just open another window.
[...]
On 12.05.2024 02:14, Lawrence D'Oliveiro wrote:
On Sat, 11 May 2024 22:44:03 -0000 (UTC), Christian Weisgerber wrote:
If no job is running, a new job gets 1, otherwise new jobs are numbered
consecutively.
Job numbers are reused after it has notified you of termination of the
previous job. At least in Bash.
Also the same behavior in Ksh, ever since I can remember; lowest job
number "available" gets re-used first. (Where "available" means that
its finishing status has been reported and not that the job finished.)
On Sat, 11 May 2024 22:44:03 -0000 (UTC), Christian Weisgerber wrote:
If no job is running, a new job gets 1, otherwise new jobs are numbered
consecutively.
Job numbers are reused after it has notified you of termination of the >previous job. At least in Bash.
On 2024-05-11, Kenny McCormack <gazelle@shell.xmission.com> wrote:
I tried it a few times, but could not get back the #1 slot.
If no job is running, a new job gets 1, otherwise new jobs are
numbered consecutively.
As I accidentally discovered while looking at the code, csh(1) tries
to recycle smaller job IDs once it goes beyond 9. tcsh(1) preserves
that behavior to this day.
I offer no opinion on this, nor on the Plan 9 assertion that job
control is a poor hack and you should just open another window.
On 12.05.2024 02:14, Lawrence D'Oliveiro wrote:
I’ve often wondered why shells don’t use poll/select-based event
loops. Then they can notify you of job termination immediately, instead
of waiting for you to press return.
It may be considered undesired in an interactive shell to unnecessarily
spoil the output of other running processes.
If job output would be
written asynchronously then you could also easily miss the output of
the job control system.
If no job is running, a new job gets 1, otherwise new jobs are numbered
consecutively.
Job numbers are reused after it has notified you of termination of the previous job. At least in Bash.
Job numbers are reused after it has notified you of termination of the >>>> previous job. At least in Bash.
Also the same behavior in Ksh, ever since I can remember; lowest job
number "available" gets re-used first. (Where "available" means that
its finishing status has been reported and not that the job finished.)
Nope. Sorry.
I read that as "in Bash it's not the case". - Can't tell; I can just
say that what LDO was claiming for Bash at least is the behavior for
Ksh. (You are not arguing that Ksh would behave differently, do you?)
In article <v1p6hr$2btq7$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
On 12.05.2024 02:14, Lawrence D'Oliveiro wrote:
On Sat, 11 May 2024 22:44:03 -0000 (UTC), Christian Weisgerber wrote:
If no job is running, a new job gets 1, otherwise new jobs are numbered >>>> consecutively.
Job numbers are reused after it has notified you of termination of the
previous job. At least in Bash.
Also the same behavior in Ksh, ever since I can remember; lowest job
number "available" gets re-used first. (Where "available" means that
its finishing status has been reported and not that the job finished.)
Nope. Sorry.
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:
In article <v1qr6l$2qsv6$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
...
Job numbers are reused after it has notified you of termination of the >>>>> previous job. At least in Bash.
Also the same behavior in Ksh, ever since I can remember; lowest job
number "available" gets re-used first. (Where "available" means that
its finishing status has been reported and not that the job finished.)
Nope. Sorry.
I read that as "in Bash it's not the case". - Can't tell; I can just
say that what LDO was claiming for Bash at least is the behavior for
Ksh. (You are not arguing that Ksh would behave differently, do you?)
You said that it does the right thing in ksh (*). LDO claimed
(incorrectly) that it does the right thing in bash. You then claimed that
it does the same thing in ksh as in bash, which is, clearly, incorrect.
Hence my Nope, Sorry.
(*) I have, just now, verified that it does the right thing in ksh - that
is, whatever version of ksh was laying around on this system for me to test with.
[...]
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