bug-bash
[Top][All Lists]
Advanced

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

bash 2.05b has a problem with command substitution that bash2.03.0(1) d


From: ANDERSSEN, Borge T.
Subject: bash 2.05b has a problem with command substitution that bash2.03.0(1) doesn't have.
Date: Wed, 11 Jun 2003 19:12:01 +0200

Subject:  bash 2.05b has a problem with command substitution that bash 
2.03.0(1) doesn't have.

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHA\VE_CONFIG_H  -I.  -I. -I./include -I./lib 
-D_GNU_SOURCE  -O2 -march=i386 -mcpu=i686
uname output: Linux ezti44 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 
i386 GNU/Linux
Machine Type: i686-pc-linux-gnu

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

Description:
    A ksh script that I have used for years with AIX, HP-UX, IRIX and SunOS
    contains the following command for obtaining the pid of the interactive 
login shell
    executing the command:

    LOGIN_PID=$(who -u | grep " `who am I | sed 's/^ *[^ ]* *\([^ ]*\).*$/\1/'` 
" | tr "\011" ' ' | tr -s " " | cut -d' ' -f7)

    Under SunOS 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-Enterprise
    with GNU bash, version 2.03.0(1)-release (sparc-sun-solaris) [obtained 
with: bash --version]
    this command also works.

    With bash 2.05b under Linux 2.4.18-14 this command doesn't work as expected.
    I have to split it up as follows to get the desired result:

    LINE=" `who am I | sed 's/^ *[^ ]* *\([^ ]*\).*$/\1/'` "
    LOGIN_PID=$(who -u | grep "$LINE" | tr "\011" ' ' | tr -s " " | cut -d' ' 
-f7)


Repeat-By:
        Please see the Description section.



Kind Regards
Børge T. Anderssen




reply via email to

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