AIX

power-server-operatingsystems.png

Operating Systems

The core of your mission-critical workloads: AIX, IBM i, and Enterprise Linux

power-ISV-Solutions1.png

ISV Solutions

Stay up to date with key capabilities running on POWER such as SAP

Business Continuity

Learn how to keep critical processes running and adapt quickly with PowerHA

power-infrastructure-security.png

Power Security

Protect your most sensitive data anywhere in your hybrid cloud

Virtualization

Check here for virtualization and management needs: HMC & CMC, PowerVC, and PowerVM

Open Source

Join our open source efforts within the IBM Power Systems portfolio

Enterprise Infrastructure as a Service

Achieve business growth with agility and flexibility with our enterprise IaaS in Power Virtual Server

Programming Languages

The hub for Programming Languages

Expand all | Collapse all

Bug in latest version of bash (5.0.18) from aixtoolbox

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

    Posted 14 days ago
    #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 14 days ago
    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 11 days ago
    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
    ------------------------------



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

    Posted 10 days ago
    I'm not sure if this is shown as is, but I suspect your redirection is improper.

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



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

    Posted 9 days ago
    Try

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

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