bug-bash
[Top][All Lists]
Advanced

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

no error detection for command substitution


From: markd
Subject: no error detection for command substitution
Date: Sun, 24 Jun 2007 13:46:28 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: amd64
OS: freebsd6.2
Compiler: cc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='amd64' 
-DCONF_OSTYPE='freebsd6.2' -DCONF_MACHTYPE='amd64-portbld-freebsd6.2' 
-DCONF_VENDOR='portbld' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' 
-DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -I/usr/local/include 
-O2 -fno-strict-aliasing -pipe
uname output: FreeBSD osprey.kermodei.com 6.2-STABLE FreeBSD 6.2-STABLE #4: Fri 
May 18 18:46:31 PDT 2007     
root@osprey.kermodei.com:/usr/src/sys/amd64/compile/OSPREY  amd64
Machine Type: amd64-portbld-freebsd6.2

Bash Version: 3.2
Patch Level: 17
Release Status: release

Description:
        There is no way to detected error when doing command substitution in
        many contexts.  With the exception of setting a variable, commands
        in command substitutions that exit non-zero are not report and do
        not terminate a script running with -e.  This makes write a robust
        script that used command substation tedious.

Repeat-By:
        set -e
        echo $(false) || echo error was detected
        echo error not detected

Fix:
        add an option similar to pipefail that aborts a compound command if
        a command substitution exits non-zero





reply via email to

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