Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!husc6!rice!sun-spots-request From: keith%tira@gargoyle.uchicago.edu (Keith Waclena) Newsgroups: comp.sys.sun Subject: Possible bug in SunOS Release 4 Bourne Shell? Keywords: SunOS Message-ID: <763@brazos.Rice.edu> Date: 4 Aug 89 22:21:42 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 48 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 93, message 13 of 16 Hardware: Sun 4/110, Sun 3/50 OS: SunOS 4.0, SunOS 4.0.1 The following shell script gives different results when invoked with standard input redirected from a file, compared to when the same file is piped into it via cat. $ cat testread.sh #!/bin/sh read FIRSTLINE read SECONDLINE (echo "$FIRSTLINE"; echo "$SECONDLINE"; cat) $ cat FOO AAA BBB CCC $ cat FOO | /bin/sh testread.sh AAA BBB CCC $ /bin/sh testread.sh