bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "builtin jobs" does not output to stdout.


From: Chet Ramey
Subject: Re: "builtin jobs" does not output to stdout.
Date: Tue, 14 Feb 2023 11:20:13 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2

On 2/13/23 6:43 AM, Koichi Murase wrote:

I guess just the support for ksh's ${ list; } [1] would make
everything simple and clear. One can simply call ${ jobs; }, ${ trap
-p; }, etc. without thinking about subshells.

[1] https://lists.gnu.org/archive/html/help-bash/2020-05/msg00077.html

The text about syntatic sugar still applies.
I haven't checked what POSIX says about the jobs in subshells,

POSIX requires that the shell execution environment include what is
essentially the jobs list;

https://www.austingroupbugs.net/view.php?id=1254

discusses this extensively. However,

"The jobs utility does not work as expected when it is operating in its own
utility execution environment because that environment has no applicable
jobs to manipulate."


but at
least Bash maintains a separate "job list" of a subshell (which is
accessible from the built-in command `jobs') regardless of whether the
"job control" is turned on or not.

POSIX requires this:

"The jobs utility is not dependent on the job control option, as are the
seemingly related bg and fg utilities because jobs is useful for examining
background jobs, regardless of the condition of job control."

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]