Re: (bash) How (really!) does the "current job" get determined?

Liste des Groupes 
Sujet : Re: (bash) How (really!) does the "current job" get determined?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell
Date : 07. Oct 2024, 03:50:31
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vdvi9o$1imug$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 05.10.2024 00:48, Christian Weisgerber wrote:
On 2024-10-04, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
 
What? Scripting should not go anywhere near POSIX job control, which is
an interactive feature that requires a terminal session.
>
Well, there _is_ set -m.
>
And how will that devaluate what Kaz has said? Please elaborate.
 
Job control does not require an interactive shell or a terminal
session.  It can be used in scripting.  That's the facts.

Yes, but for one that doesn't explain why you emphasized 'set -m',
and your example below - certainly reasonable for discussion! - I
don't find convincing. In contrast to '$!' that you get and work
with there's no (no easy?) way to obtain the job number that the
shell assigns! And (for concerning your question below) you have
alway 'wait' available, for both, PIDs or job numbers (at least
in Kornshell; don't know about Bash or what POSIX says about it).

Janis

 
or if you know of any useful and sensible application contexts
for non-interactive usages I'd certainly be curious to know.[*]
 
I'm curious myself.  That said, here's something I stumbled across
recently:
 
    background job &
    ...
    kill %1     # clean up
 
What happens if the background job has already terminated on its
own accord before we reach the kill(1)?  Not much, because with job
control, the shell knows that no such job exists.  If you do this
with "kill $!", you signal that PID, which no longer refers to the
intended process and may in fact have been reused for a different
process.
 


Date Sujet#  Auteur
4 Oct 24 * (bash) How (really!) does the "current job" get determined?33Kenny McCormack
4 Oct 24 `* Re: (bash) How (really!) does the "current job" get determined?32Kaz Kylheku
4 Oct 24  `* Re: (bash) How (really!) does the "current job" get determined?31Kenny McCormack
4 Oct 24   `* Re: (bash) How (really!) does the "current job" get determined?30Kaz Kylheku
4 Oct 24    +* Expand your mind (Was: (bash) How (really!) does the "current job" get determined?)2Kenny McCormack
5 Oct 24    i`- Re: Expand your mind (Was: (bash) How (really!) does the "current job" get determined?)1Kaz Kylheku
4 Oct 24    `* Re: (bash) How (really!) does the "current job" get determined?27Christian Weisgerber
4 Oct 24     `* Re: (bash) How (really!) does the "current job" get determined?26Janis Papanagnou
5 Oct 24      `* Re: (bash) How (really!) does the "current job" get determined?25Christian Weisgerber
5 Oct 24       +* Re: (bash) How (really!) does the "current job" get determined?2Kaz Kylheku
10 Oct 24       i`- Re: (bash) How (really!) does the "current job" get determined?1Kaz Kylheku
5 Oct 24       +- Re: (bash) How (really!) does the "current job" get determined?1Keith Thompson
5 Oct 24       +* Re: (bash) How (really!) does the "current job" get determined?13Kenny McCormack
5 Oct 24       i+* Re: (bash) How (really!) does the "current job" get determined?11Christian Weisgerber
5 Oct 24       ii`* pid ranges (Was: (bash) How (really!) does the "current job" get determined?)10Kenny McCormack
7 Oct 24       ii `* Re: pid ranges (Was: (bash) How (really!) does the "current job" get determined?)9Janis Papanagnou
7 Oct 24       ii  +- Re: pid ranges (Was: (bash) How (really!) does the "current job" get determined?)1marrgol
7 Oct 24       ii  `* Re: pid ranges (Was: (bash) How (really!) does the "current job" get determined?)7Kenny McCormack
7 Oct 24       ii   `* Re: pid ranges (Was: (bash) How (really!) does the "current job" get determined?)6Janis Papanagnou
7 Oct 24       ii    `* Re: pid ranges5Richard Kettlewell
7 Oct 24       ii     `* [OT] PIDs for Linux threads (was Re: pid ranges)4Janis Papanagnou
7 Oct 24       ii      +- Re: [OT] PIDs for Linux threads (was Re: pid ranges)1Kenny McCormack
7 Oct 24       ii      +- Re: [OT] PIDs for Linux threads (was Re: pid ranges)1Lew Pitcher
7 Oct 24       ii      `- Re: PIDs for Linux threads (was Re: pid ranges)1Lawrence D'Oliveiro
6 Oct 24       i`- Re: (bash) How (really!) does the "current job" get determined?1Kaz Kylheku
7 Oct 24       +* Re: (bash) How (really!) does the "current job" get determined?5Janis Papanagnou
7 Oct 24       i`* Re: (bash) How (really!) does the "current job" get determined?4Kenny McCormack
7 Oct 24       i `* Re: (bash) How (really!) does the "current job" get determined?3Janis Papanagnou
7 Oct 24       i  `* bash/ksh differences (fg and other job control commands) (Was: (bash) How (really!) does the "current job" get determined?)2Kenny McCormack
7 Oct 24       i   `- Re: bash/ksh differences (fg and other job control commands) (Was: (bash) How (really!) does the "current job" get determined?)1Janis Papanagnou
7 Oct 24       +- Re: (bash) How (really!) does the "current job" get determined?1Helmut Waitzmann
8 Oct 24       +- Re: (bash) How (really!) does the "current job" get determined?1Richard Harnden
8 Oct 24       `- Re: (bash) How (really!) does the "current job" get determined?1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal