On 8/12/16 4:14 AM, dengke...@windriver.com wrote: > I used the strace tool to follow it. I touch a file named lastpipe just > contain: > > shopt -s lastpipe > exit 142 | false > > run command:)$ ./bash --version
OK. $ ./bash --version GNU bash, version 4.3.46(3)-release (x86_64-unknown-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. $ cat x1 shopt -s lastpipe exit 142 | false echo ${PIPESTATUS[@]} $ ./bash ./x1 142 1 $ uname -a Linux chet-mail 2.6.32-642.1.1.el6.x86_64 #1 SMP Fri May 6 14:54:05 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/