sh and csh scripts (SCO ODT 1.0 with SCO Unix 3.2.1)

Kannan Konath konath at sj.ate.slb.com
Fri Feb 1 12:50:45 AEST 1991


In article <1991Jan29.230217.14825 at informix.com> aland at informix.com (Colonel Panic) writes:
>Now, the bonus question: is there an analogous directive for setting 
>up a C shell script that will work in non-BSD systems ('#!/bin/csh' 
>doesn't cut it in SVR3)?

Actually, I had asked this question originally and it got lost in
all the responses.

If you use csh you can execute either sh or csh scripts.

If the first character of a shell script starts with a # then
then the script will be treated as a csh script.  If the first
character is anything but a # (I find it's usually a colon ":")
then the script will be treated as a bourne shell script.

You should however use the csh when doing such things.  There
is a short paragraph in the man pages of both sh and csh (SCO ODT 1.0)
that mention this behaviour.  It's an extremely clumsy way of
System V R3 doing things.  

But this is not as irritating as trying to extract tar files in which
file or directory names happen to be longer than 14 characters.  I
spend half my time counting the number of characters in filenames.
I wish they had kept the length of filenames down to 8 characters
since it's much easier to detect this at a  glance.  Fourteen
character gives you a headache and the ability to count to 14. 

kannan
konath at sj.ate.slb.com



More information about the Comp.unix.sysv386 mailing list