Sujet : Re: (bash) How (really!) does the "current job" get determined?
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.unix.shellDate : 07. Oct 2024, 12:48:06
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <ve0hpm$2tnuv$1@news.xmission.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vdvi9o$1imug$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
...
In contrast to '$!' that you get and work
with there's no (no easy?) way to obtain the job number that the
shell assigns!
I showed a method in an earlier post; it consists of piping the output of
"jobs -l" into an AWK script (that matches on $!). It isn't pretty, but it
works.
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).
What annoys me is that (in bash), most, but not all, of the job control
related commands take either a pid or a job number. To be clear, what
annoys me is that they don't *all* do. In particular, "fg" only takes a
job number. "disown" takes either, which is a very good thing. Wish they
all did.
-- If Jeb is Charlie Brown kicking a football-pulled-away, Mitt is a '50shousewife with a black eye who insists to her friends the roast wasn'tdry.