SVR4 /bin/sh BUG

Malcolm Mladenovic mbm at dsbc.icl.co.uk
Sat Jun 1 23:35:16 AEST 1991


In article <20798 at uudell.dell.com> jrh at mustang.dell.com (Randy Howard) writes:
>In article <1991May30.171404.23422 at cbnewsl.att.com>, urban at cbnewsl.att.com (john.urban) writes:
>|> In article <1991May30.034223.29061 at digibd.com> rick at digibd.com (Rick Richardson) writes:
>|> >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.

It will work with ksh - see below.

>
>Well, that may be true, but the AT&T Release 4.0 Version 3.0 'reference port' 
>or 'Test Engine' as it is sometimes called definitely DOES FAIL.  It is 
>somewhat interesting that if you run it under ksh with: 'truss shbug' it will
>also fail at the same point it does in sh.

This bug is caused by the same problem that was mentioned some time ago
in this group, namely redirection on 'exec' and ':' builtins do not work
correctly.

For ksh, only the second form fails, eg

#!/bin/ksh
for i in a b c d e f g h
do
	: >$i
done

only creates file 'a'.

The exec variety fails on sh in rather more obscure ways.

Neither of these shells is fixed on the 'Version 3.0' 386 tape, from
a quick look at the code. I have built the sh source and it fails
the test as reported by Randy above.

The reason a 'truss shbug' run from ksh fails is that truss uses execvp
(and hence sh) to invoke the program.

-Malcolm

-- 
Malcolm Mladenovic				mbm at dsbc.icl.co.uk
standard disclaimer applies



More information about the Comp.bugs.sys5 mailing list