AIX

 View Only
  • 1.  Bug in latest version of bash (5.0.18) from aixtoolbox

    Posted Fri April 30, 2021 08:55 AM
    #oslevel -s
    7200-05-02-2114
    #rpm -q bash
    bash-5.0.18-1.ppc
    #echo $BASH_VERSION
    5.0.18(1)-release
    #while read i
    > do
    > echo $i
    > done < <(awk -F':' '{print $1}' /etc/passwd)
    root
    daemon
    bin
    sys
    adm
    uucp
    guest
    nobody
    lpd
    lp
    invscout
    snapp
    ipsec
    nuucp
    pconsole
    sshd
    oracle
    zabbix
    smmsp

    ^C
    #

    It just hangs there until I interrupt it with Ctrl+C (loop does not exit by itself).
    It used to work in previous versions of bash.

    If I use this syntax, it works as expected (echoes all the usernames from /etc/passwd and exits):
    #awk -F':' '{print $1}' /etc/passwd | while read i
    > do
    > echo $i
    > done


    Regards,
    Romeo

    ------------------------------
    Romeo Mikulic
    ------------------------------


  • 2.  RE: Bug in latest version of bash (5.0.18) from aixtoolbox

    Posted Fri April 30, 2021 09:03 AM
    Please use AIX open source discussion forum to report and discuss issue related to AIX toolbox and open source.
    We have identified an issue with bash recently and this looks similar.
    Please add your issue to the bash thread or open a new thread in the AIX open source discussion forum.

    ------------------------------
    SANKET RATHI
    ------------------------------



  • 3.  RE: Bug in latest version of bash (5.0.18) from aixtoolbox

    Posted Wed June 09, 2021 10:32 AM
    Sanket, you were right, it was the same issue as described in the bash thread.

    I can confirm the issue is resolved in latest version of bash (5.1.4) uploaded to aixtoolbox two days ago:

    ftp://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/bash/bash-5.1.4-1.aix6.1.ppc.rpm

    Thank you and thank everyone for suggestions,

    ------------------------------
    Romeo Mikulic
    ------------------------------



  • 4.  RE: Bug in latest version of bash (5.0.18) from aixtoolbox

    Posted Mon May 03, 2021 10:21 AM
    Romeo, might this be a script issue, instead? I seem to recall a similar issue with ksh in a "while read" inside a "while read". IIRC, the issue is that the second read on stdin is waiting for the first read on stdin to finish. And it never does. Probably not the best explanation, but you might code a different approach with better success. Hmmm...on second thought, I looked at your script too quickly. I thought I saw two successive "reads", but now  I do not.
    Well, for what it's worth, the same code could be run in different shells: ksh, bsh, bash, etc. If it succeeds in ksh and bsh but not in bash, then I'd say you're on to something, here.

    ------------------------------
    Mackey Morgan
    ------------------------------



  • 5.  RE: Bug in latest version of bash (5.0.18) from aixtoolbox

    Posted Tue May 04, 2021 12:57 PM
    I'm not sure if this is shown as is, but I suspect your redirection is improper.

    ------------------------------
    Bruce
    ------------------------------



  • 6.  RE: Bug in latest version of bash (5.0.18) from aixtoolbox

    Posted Wed May 05, 2021 03:53 PM
    Try

    # awk -F':' '{print $1}' /etc/passwd | while read i ; do echo $i ; done

    ------------------------------
    Bernhard Zeller
    ------------------------------