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
------------------------------
Original Message:
Sent: Fri April 30, 2021 07:43 AM
From: Romeo Mikulic
Subject: Bug in latest version of bash (5.0.18) from aixtoolbox
#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
------------------------------