bug-bash
[Top][All Lists]
Advanced

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

Re: extdebug now implies errtrace which implies `trap ... ERR` execution


From: Oğuz
Subject: Re: extdebug now implies errtrace which implies `trap ... ERR` execution w/out `set -e`
Date: Tue, 9 Feb 2021 08:06:08 +0300

9 Şubat 2021 Salı tarihinde Mike Frysinger <vapier@gentoo.org> yazdı:

> $ cat test.sh
> #!/bin/bash
> foo() {
>   false
>   return 0
> }
> shopt -s extdebug
> trap 'echo invalid trap; exit 1' ERR
> foo
> echo "pass"
> $ bash-4.3 ./test.sh
> pass
> $ bash-4.4 ./test.sh
> invalid trap
>

The manual says that when extdebug is on, functions inherit the ERR trap. I
think 4.4 behaves just as expected here


-- 
Oğuz


reply via email to

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