Re: PIPESTATUS differs from $? for compound command

2024-12-12 Thread Lawrence Velázquez
On Thu, Dec 12, 2024, at 2:01 AM, Mike Jonkmans wrote: > Yes, the posix grammar doesn't allow it. > But it is not clear, from the bash documentation, > that a pipeline is not a command. Sure, the documentation doesn't explicitly say that. But it also doesn't say that pipelines are composed of pip

Re: PIPESTATUS differs from $? for compound command

2024-12-12 Thread Mike Jonkmans
On Thu, Dec 12, 2024 at 03:56:52AM -0500, Lawrence Velázquez wrote: > On Thu, Dec 12, 2024, at 2:01 AM, Mike Jonkmans wrote: > > Yes, the posix grammar doesn't allow it. > > But it is not clear, from the bash documentation, > > that a pipeline is not a command. > Sure, the documentation doesn't exp

Re: PIPESTATUS differs from $? for compound command

2024-12-12 Thread Chet Ramey
On 12/11/24 2:44 AM, Ulrich Müller wrote: Yes, you can make the case that compound commands are pipelines, and, according to the grammar, they are, but their status is always available in $?, and they never have more than one status value. In other words, this was a design choice? Yes. On

Re: PIPESTATUS differs from $? for compound command

2024-12-12 Thread Chet Ramey
On 12/12/24 2:01 AM, Mike Jonkmans wrote: Moreover, bash accepts e.g.: ! ! false How can you parse that, without a pipeline being a command? Note that this is not posix, though bash accepts it even with --posix. I implemented it that way because the original proposal https://www.austi

Re: PIPESTATUS differs from $? for compound command

2024-12-12 Thread microsuxxor
a COMMAND is a WORD says somewhere .. somewhere .. On Thu, Dec 12, 2024, 5:56 PM Mike Jonkmans wrote: > On Thu, Dec 12, 2024 at 03:56:52AM -0500, Lawrence Velázquez wrote: > > On Thu, Dec 12, 2024, at 2:01 AM, Mike Jonkmans wrote: > > > Yes, the posix grammar doesn't allow it. > > > But it is no

Re: history-search-* and undo lists

2024-12-12 Thread Grisha Levit
On Mon, Dec 2, 2024 at 1:56 PM Chet Ramey wrote: > > On 11/18/24 10:22 PM, Grisha Levit wrote: > > But here's a remaining one in combination with history-expand-line: > > Thanks for the report. I'm not sure what to do about this one yet. > > > > > HISTFILE= INPUTRC=/ bash --norc -in <<< \ > > $'X\

Re: PIPESTATUS differs from $? for compound command

2024-12-12 Thread Chet Ramey
On 12/11/24 9:54 PM, Dale R. Worley wrote: This needs to be corrected to note that compound commands that are not one component of a multi-command pipeline do not cound as pipelines for setting PIPESTATUS. Exactly which compounds commands don't set PIPESTATUS needs to be made clear as it's not

Re: history-search-* and undo lists

2024-12-12 Thread Chet Ramey
On 12/12/24 2:07 PM, Grisha Levit wrote: FWIW there's still a use-after-free with something like: HISTFILE= INPUTRC=/ bash --norc -in <<< $'X\n\cPX\cR\n!\e3X\e^\n\cP' Thanks for the report. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brev