Xref: utzoo comp.unix.shell:2283 comp.unix.wizards:25780 comp.unix.sysv386:8524 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!digibd!rick From: rick@digibd.com (Rick Richardson) Newsgroups: comp.unix.shell,comp.unix.wizards,comp.unix.sysv386 Subject: SVR4 /bin/sh BUG Summary Message-ID: <1991May29.162012.25888@digibd.com> Date: 29 May 91 16:20:12 GMT Organization: DigiBoard Incorporated, Eden Prairie, MN Lines: 47 I recently posted the enclosed script which demonstrates a bug in SVR4's Bourne shell. With the help of the net, it appears that the bug is not restricted to just one architecture. Failure has been reported on: AT&T SVR4 on i386 HCI SVR4 on i386 Commodore SVR4 on Amiga SVR4 on i860 -Rick # # Demonstrates bug in SVR4 /bin/sh # Works OK with /bin/sh on SVR3 and XENIX # Works OK with /bin/ksh on SVR4 # # Should output the first line of /etc/passwd four times # Only does it three times on SVR4 and then hangs # # Seems to be related to changing fd0 in a function # read_by_func() { exec 3<&0 0<$1 read x echo $x exec 0<&3 3<&- } exec 3<&0 0