Shell Script question

Len Reed lbr at holos0.uucp
Thu Mar 22 03:01:24 AEST 1990


In article <4571 at ibmpa.UUCP> mcoffey at mcoffey.aix.kingston.ibm.com (Michael Coffey) writes:
>I am using XENIX 2.3.1 on an AT clone. I like using the c-shell, and most
>of my shell scripts are written for it. I have a bourne shell script that I
>would like to use but don't have time to convert it to C-Shell. I thought
>having line 1 of the script something like #!/bin/sh
>would cause the bourne shell to be used.

For some stupid reason SCO never incorporated this convention into either
their csh or Bourne shell.  It would be nice to tag awk, perl, sed, etc.
scripts this way.

The SCO csh looks at the first line of a script.  If it starts with '#' it's
a csh script.  Therefore, your "#!/bin/sh" causes this to be run by the csh!
I put a single line containing only a colon at the start of each of
my Bourne shells scripts, and they run fine out of the csh or Bourne shell.

Running a csh script from a Bourne shell is messier.  You have to explicitly
run the csh, as in "csh script_name".
-- 
Len Reed
Holos Software, Inc.
Voice: (404) 496-1358
UUCP: ...!gatech!holos0!lbr



More information about the Comp.unix.xenix mailing list