Re: Misleading NEWS for assignment before function

2025-01-13 Thread Ulrich Müller
> On Mon, 13 Jan 2025, Chet Ramey wrote: >> NEWS, bash-5.1, item 1.o. says: >> o. Bash posix mode now treats assignment statements preceding shell >> function definitions the same as in its default mode, since POSIX >> has changed and no longer requires those assignments to persist after >> t

Misleading NEWS for assignment before function

2025-01-10 Thread Ulrich Müller
NEWS, bash-5.1, item 1.o. says: o. Bash posix mode now treats assignment statements preceding shell function definitions the same as in its default mode, since POSIX has changed and no longer requires those assignments to persist after the function returns (POSIX interp 654). This refers

Re: PIPESTATUS differs from $? for compound command

2024-12-10 Thread Ulrich Müller
>>>>> On Tue, 10 Dec 2024, Chet Ramey wrote: > On 12/9/24 12:21 PM, Ulrich Müller wrote: >> Bash Version: 5.2 >> Patch Level: 37 >> Release Status: release >> Description: >> For a compound command like "if" or "while" and wit

Re: PIPESTATUS differs from $? for compound command

2024-12-10 Thread Ulrich Müller
> On Tue, 10 Dec 2024, Greg Wooledge wrote: > My own testing: > hobbit:~$ if true; then (exit 11) | cat; fi > hobbit:~$ echo "$? ${PIPESTATUS[*]}" > 0 11 0 > hobbit:~$ if true; then (exit 11) | cat; fi | false > hobbit:~$ echo "$? ${PIPESTATUS[*]}" > 1 0 1 > hobbit:~$ while (exit 12); do :;

Re: PIPESTATUS differs from $? for compound command

2024-12-10 Thread Ulrich Müller
> On Mon, 09 Dec 2024, Mike Jonkmans wrote: >> Why is `if false; then :; fi' not a pipeline? It is a command, and the >> components of a pipeline are commands. > It is a pipeline indeed, but not the last (doc says: most-recently-executed). > The last is the 'false' simple command/pipeline.

PIPESTATUS differs from $? for compound command

2024-12-09 Thread Ulrich Müller
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -march=native -ggdb -O2 -pipe uname output: Linux urania 6.6.62-gentoo #1 SMP Wed Nov 20 14:40:27 CET 2024 x86_64 AMD Ryzen 7 PRO 7730U with Radeo