Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!cs.utexas.edu!uunet!ncrlnk!cipc1!tbertels From: tbertels@cipc1.Dayton.NCR.COM (Tom Bertelson) Newsgroups: comp.sys.att,comp.unix.i386 Subject: Re: Forcing /bin/sh in a script under V/386 3.2 Korn shell Message-ID: <1190@cipc1.Dayton.NCR.COM> Date: 14 Jul 89 17:25:11 GMT References: <14445@bfmny0.UUCP> <1989Jul11.225839.14835@ziebmef.uucp> Reply-To: tbertels@cipc1.Dayton.NCR.COM (Tom Bertelson) Followup-To: comp.sys.att Organization: NCR World Telecomputing Center - Dayton, OH Lines: 20 In article <1989Jul11.225839.14835@ziebmef.uucp> cks@ziebmef.uucp (Chris Siebenmann) writes: > On a BSD Unix, one could put "#! /bin/sh" at the start of your script >and it would work. Unfortunately, System V doesn't have this (and >worse yet, your vendor has gratuitusly hacked csh so many scripts will >break under it), so the best substitute (swiped from Perl v2's >Configure script) is: > > (alias) >/dev/null 2>&1 && (exec /bin/sh $0 ${1+"$@"}) A minor nit. If you have an interactive program called "alias" on your system (as I discovered here) you could be in for a surprise. Try instead (PATH= alias) >/dev/null 2>&1 && (exec /bin/sh $0 ${1+"$@"}) Some day I'll send this off to Larry Wall ... -- Tom Bertelson DISCLAIMER: My opinions are my own and Tom.Bertelson@Dayton.NCR.COM in no way reflect those of my employer. ...!uunet!ncrlnk!cipc1!tbertels