bug-bash
[Top][All Lists]
Advanced

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

Re: PIPESTATUS doesn't work in login shell


From: Chet Ramey
Subject: Re: PIPESTATUS doesn't work in login shell
Date: Thu, 5 Dec 2002 16:56:25 -0500

> The Bash builtin PIPESTATUS works as advertized unless you are at
> a login shell.  Here is the output:
> 
> /faculty/wpollock> uname -a
> Linux localhost 2.4.18-18.7.x #1 Wed Nov 13 20:29:30 EST 2002 i686
> unknown
> /home/wpollock> bash --version
> GNU bash, version 2.05.8(1)-release (i386-redhat-linux-gnu)
> Copyright 2000 Free Software Foundation, Inc.
> /home/wpollock> who | grep nobodyishome | sort
> /home/wpollock> echo ${PIPESTATUS[*]}
> 0
> /home/wpollock> bash
> (2) /home/wpollock> who | grep nobodyishome | sort
> (2) /home/wpollock> echo ${PIPESTATUS[*]}
> 0 1 0
> (2) /faculty/wpollock>

You've probably got PROMPT_COMMAND set in your login shell, or some other
process that runs before the prompt gets printed that resets PIPESTATUS.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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