bug-bash
[Top][All Lists]
Advanced

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

Re: 'wait -n' with and without id arguments


From: Chet Ramey
Subject: Re: 'wait -n' with and without id arguments
Date: Thu, 5 Sep 2024 12:10:42 -0400
User-agent: Mozilla Thunderbird

On 8/30/24 11:06 PM, Zachary Santer wrote:
CWRU/CWRU.chlog:
 >    8/26
 >    ----

 > execute_cmd.c
 > [...]
 > - execute_connection: in default mode, bash performs jobs notifications
 >   in an interactive shell between commands separated by ';' or '\n'.
 >   It shouldn't do this in posix mode, since posix now specifies when
 >   notifications can take place

I forgot your comment below about the shell not being interactive any time it's not accepting input from the user and took this to mean that 'jobs' notifications would only ever be printed immediately prior to a prompt when bash is in posix mode. I don't understand what posix mode changes relative to the existing behavior if not that.

In default mode, bash prints job notifications when executing a list (it
calls lists `connections' internally). Commands in lists can be delimited
by a `;' or newline; bash performs notifications between executing, say,
the left and right sides of `command 1; command 2'. Now it doesn't do that
in posix mode. It still does job notifications in other places that aren't
strictly posix conformant.


 > jobs.c
 > - notify_and_cleanup: make interactive shells notifying during sourced
 >   scripts dependent on the shell compatibility level and inactive in
 >   versions beyond bash-5.2
>   Inspired by report from Zachary Santer <zsanter@gmail.com <mailto:zsanter@gmail.com>>

Making 'jobs' notifications not happen while the interactive shell is sourcing a script misses the cases where a function is otherwise executed directly from the command line and of course a whole bunch of commands separated by semicolons entered in one command line.

What behavior do you want from the command lists that differs from what I
described above? Since shell functions are essentially lists, you should
get the same behavior from both.

--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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