Article View: comp.bugs.sys5
Article #412Re: SVR4 /bin/sh BUG
From: john.urban
Date: Thu, 30 May 1991 17:14
Date: Thu, 30 May 1991 17:14
47 lines
1547 bytes
1547 bytes
In article <1991May30.034223.29061@digibd.com> rick@digibd.com (Rick Richardson) writes:
>I'm posting this here in the hopes that the various
>vendors of SVR4 fix this in their next releases.
>Known to fail on AT&T, HCI, Commodore, and i860 SVR4's.
Your program DOES NOT FAIL on AT&T UNIX System V/386 Release 4.0 Version 2.1.
I verified that it works fine with the ksh and the sh.
Sincerely,
John Ben Urban
>
>#
># 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</etc/passwd
>read x
>echo $x
>exec 0<&3 3<&-
>
>exec 3<&0 0</etc/passwd
>read x
>echo $x
>exec 0<&3 3<&-
>
>read_by_func /etc/passwd
>
># Gets stuck here with /bin/sh...
>read_by_func /etc/passwd
>--
>Rick Richardson Email: rick@digibd.com
>Senior MTS Fax: (612) 943-0803
>DigiBoard, Inc. Tel: (612) 943-5383
Technical Details
Message-ID:
<1991May30.171404.23422@cbnewsl.att.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!wuarchive!uwm.edu!linac!att!att!cbnewsl!urbanReferences:
<1991May30.034223.29061@digibd.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!wuarchive!uwm.edu!linac!att!att!cbnewsl!urban From: urban@cbnewsl.att.com (john.urban) Newsgroups: comp.bugs.sys5 Subject: Re: SVR4 /bin/sh BUG Message-ID: <1991May30.171404.23422@cbnewsl.att.com> Date: 30 May 91 17:14:04 GMT References: <1991May30.034223.29061@digibd.com> Organization: AT&T Bell Laboratories Lines: 47