Shell scripts starting with "#"

Tom Gillespie tag at mtunf.ATT.COM
Thu Oct 18 04:30:29 AEST 1990


In AT&T System V Release 3 for 3B2, neither

#!/bin/sh

nor

: use /bin/sh

will force Bourne shell execution; Korn shell Version 11/16/88 simply ignores
either one. (csh does not exist for 3B2 as far as I know).

For 6386, which does have csh,

: use /bin/sh

works reliably; again, Korn shell (same version) ignores it.

My favorite workaround:

(alias) >/dev/null 2>&1 && exec /bin/sh $0 $@

since 'alias' is a built-in command in ksh.  This is the test that Larry Wall's
metaconfig builds in to the Configure script to warn ksh users that Bourne
shell should probably be used instead.


Tom Gillespie
tag at mtunf.att.com
(201) 576-2338



More information about the Comp.unix mailing list