bug-bash
[Top][All Lists]
Advanced

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

PIPESTATUS and PROMPT_COMMAND (mis)interaction


From: b_d_low
Subject: PIPESTATUS and PROMPT_COMMAND (mis)interaction
Date: Mon, 10 Mar 2003 21:46:38 +1100

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -I.  
-I/home/packages/bash/bash-2.05b -I/home/packages/bash/bash-2.05b/include 
-I/home/packages/bash/bash-2.05b/lib  -g -O2
uname output: Linux gromit 2.4.18 #1 Mon Oct 28 00:42:32 EST 2002 i686 Pentium 
II (Klamath) GenuineIntel GNU/Linux
Machine Type: i386-pc-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:

PIPESTATUS is updated by PROMPT_COMMAND, in contrast to $?.

Consistency and Chet Ramey's comments of Sep 01 [1] suggest this is not 
the intended behaviour.

[1] 
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=010906153114.AA48126.SM%40nike.ins.cwru.edu

Repeat-By:

$ PROMPT_COMMAND=true
$ true | false | true | false
$ echo ${PIPESTATUS[*]}
0
$ true | false | true | false;  echo ${PIPESTATUS[*]}
0 1 0 1
$
$ unset PROMPT_COMMAND
$ true | false | true | false
$ echo ${PIPESTATUS[*]}
0 1 0 1






reply via email to

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