Deutsch   English   Français   Italiano  
<ve0hpm$2tnuv$1@news.xmission.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: (bash) How (really!) does the "current job" get determined?
Date: Mon, 7 Oct 2024 11:48:06 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ve0hpm$2tnuv$1@news.xmission.com>
References: <vdn864$2p69n$1@news.xmission.com> <vdpgf0$bchi$1@dont-email.me> <slrnvg0s5f.1qk1.naddy@lorvorc.mips.inka.de> <vdvi9o$1imug$1@dont-email.me>
Injection-Date: Mon, 7 Oct 2024 11:48:06 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
	logging-data="3071967"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
Bytes: 1988
Lines: 24

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 '50s
housewife with a  black eye who insists to her  friends the roast wasn't
dry.