Bourne Shell Comments Problem
Tony Cratz
cratz at datack.UUCP
Tue Oct 4 03:05:05 AEST 1988
In article <8608 at smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <1628 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>>In article <8567 at smoke.ARPA>, gwyn at smoke.ARPA (Doug Gwyn ) writes:
>>> Nearly all Bourne shell scripts I have encountered in the past
>>> several years start with #.
>>You must not have used systems with the csh available then, since csh (not
>>sh) uses the first character to determine whether to pass the script off onto
>>the bourne shell.
.
.
.
>However, a port of csh to UNIX System V should NOT "exec" scripts using
>csh, and a Bourne shell even on BSD should never do this. On BSD systems,
>the #! kludge can be used to force the right interpreter; on UNIX System V
>this is not usually supported, and since csh is not standard on UNIX
>System V in that environment shell scripts should always be executed by a
>Bourne shell (except for explicit "csh <foo" or "csh foo", of course).
>
>I notice that few porters of csh to a UNIX System V environment seem to
>be familiar enough with the UNIX System V environment to fix such
>incompatibilities when they do the port.
I have found that on the different sytems that I have worked on so far that
under SYS V.2 that if you start your Bourne Shell scripts with the bourne
shell comment ':' that it will always run the shell as bourne. I had to
find some way to port shell scripts from BSD to SYS V.2 that I could be
be sure of working. Now all of my Bourne shell scripts start with the
following line
: !/bin/sh (run script as Broune Shell)
--
"Looks like plant food to me"
Tony Cratz work phone: (408) 982-3585
UUCP: uunet!altnet!datack!cratz
Snail: Datachecker, 800 Central Expressway MS 33-36, Santa Clara, Ca 95052
More information about the Comp.unix.questions
mailing list