Path: utzoo!attcan!uunet!lll-winken!lll-lcc!pyramid!csg From: csg@pyramid.pyramid.com (Carl S. Gutekunst) Newsgroups: comp.sys.pyramid Subject: Re: read bug in 4.4 /bin/sh? Message-ID: <63330@pyramid.pyramid.com> Date: 20 Mar 89 19:35:12 GMT References: <8903201700.AA00197@era.ucar.edu.UCAR.EDU> Organization: Pyramid Technology Corp., Mountain View, CA Lines: 16 In article <8903201700.AA00197@era.ucar.edu.UCAR.EDU> era@NIWOT.UCAR.EDU writes: >#!/bin/sh >read x < $0 >echo x = $x Redirection of the "read" command is not supported in the 4.3BSD Bourne shell; it is supported in the System V Bourne shell. So, this works on SunOS and the Pyramid's att universe, but does not on Ultrix or the Pyramid's ucb universe. You can do what you want -- better I think -- using head(1): #!/bin/sh x=`head -1 $0` echo x = $x