bug-bash
[Top][All Lists]
Advanced

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

Re: bash 2.05b has a problem with command substitution that bash2.03.0(1


From: Paul Jarc
Subject: Re: bash 2.05b has a problem with command substitution that bash2.03.0(1) doesn't have.
Date: Thu, 12 Jun 2003 16:44:54 -0400
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Chet Ramey <chet@nike.ins.cwru.edu> wrote:
>>     I have to split it up as follows to get the desired result:
>>
>>     LINE=3D" `who am I | sed 's/^ *[^ ]* *\([^ ]*\).*$/\1/'` "
>>     LOGIN_PID=3D$(who -u | grep "$LINE" | tr "\011" ' ' | tr -s " " | cut 
>> -d' ' -f7)
>
> This is not a bash bug.  It's a difference between Linux and the other
> versions of Unix.  When you run the command substitution in a pipeline,
> the process has no controlling terminal, and `who am I' returns nothing.

The process still has a controlling terminal, but that terminal is no
longer connected to stdin.  Apparently, this "who" is expecting stdin
to refer to the terminal.  It could use /dev/tty instead, in a case
like this.  Børge, you could report this to bug-coreutils@gnu.org,
assuming you are using GNU who.


paul




reply via email to

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