Re: (Buglet) job numbers do not get re-used (sometimes)

Stan Marsh <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
From:	Wiley Young
Subject: Re:  (Buglet) job numbers do not get re-used (sometimes)
Date:	Mon, 17 Aug 2026 10:08:14 -0700

>How about using an alias?

>~ $ alias
>alias %1='bgpid=$( jobs -l | awk "\$3 !~ /^(Term|Kill).+\$/ && \$2
>~/^[0-9]+\$/ { print \$2; exit 0 }" ); if [[ -n ${bgpid} ]]; then kill
>"${bgpid}"; else printf "%%1: no such job\n"; fi; unset bgpid'
>~ $

Nice to see that comedy is not dead.

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic
answers.  If you have nothing useful to say, then just click Next and go on.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.