bug-bash
[Top][All Lists]
Advanced

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

PIPESTATUS not altered by $(())


From: Eric Blake
Subject: PIPESTATUS not altered by $(())
Date: Sun, 16 Nov 2008 14:38:14 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
- -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc'
- -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H
- -DRECYCLES_PIDS   -I.  -I/home/eblake/bash-3.2.39-20/src/bash-3.2
- -I/home/eblake/bash-3.2.39-20/src/bash-3.2/include
- -I/home/eblake/bash-3.2.39-20/src/bash-3.2/lib   -O2 -pipe
uname output: CYGWIN_NT-5.1 LOUNGE 1.5.25(0.156/4/2) 2008-06-12 19:34 i686
Cygwin
Machine Type: i686-pc-cygwin

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

Description:
        $? and $PIPESTATUS[*] should always agree with each other, but
there are situations where the latter is not properly updated.  In the
example below, a failed arithmetic substitution sets $? but not $PIPESTATUS.

Repeat-By:
$ PS1=' ${PIPESTATUS[*]} \$ '
 0 $ echo $?
0
 0 $ echo $((+))
bash: +: syntax error: operand expected (error token is "+")
 0 $ echo $?
1
 0 $

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkgksYACgkQ84KuGfSFAYDCWgCg0UKd/m1th5e6b5uNQfgfsfk7
gVMAn1V5LR+qFbsNjLCcfFCKZxRHqhEw
=3Eju
-----END PGP SIGNATURE-----




reply via email to

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