"trap" output from "if" statement redirected wrongly

2022-04-13 Thread Frank Heckenbach
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux mars 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64 GNU/Lin

Re: "trap" output from "if" statement redirected wrongly

2022-04-13 Thread Jesse Hathaway
On Wed, Apr 13, 2022 at 7:59 AM Frank Heckenbach wrote: > This script writes "foo" to bar rather than stdout as I'd expect. > > It's triggered by the "if" statement (which doesn't even cause > running in a subshell, so it's not that). > > #!/bin/bash > set -e > trap 'echo foo' 0 > #false > bar #

Re: "trap" output from "if" statement redirected wrongly

2022-04-13 Thread Frank Heckenbach
> On Wed, Apr 13, 2022 at 7:59 AM Frank Heckenbach > wrote: > > This script writes "foo" to bar rather than stdout as I'd expect. > > > > It's triggered by the "if" statement (which doesn't even cause > > running in a subshell, so it's not that). > > > > #!/bin/bash > > set -e > > trap 'echo foo'

Bash-5.2-beta available

2022-04-13 Thread Chet Ramey
The first beta release of bash-5.2 is now available with the URLs ftp://ftp.cwru.edu/pub/bash/bash-5.2-beta.tar.gz https://ftp.gnu.org/pub/gnu/bash/bash-5.2-beta.tar.gz and from the bash-5.2-testing branch in the bash git repository (http://git.savannah.gnu.org/cgit/bash.git/log/?h=bash-5.2-testi