Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!mips!sjsca4!konath From: konath@sj.ate.slb.com (Kannan Konath) Newsgroups: comp.unix.sysv386 Subject: Re: sh and csh scripts (SCO ODT 1.0 with SCO Unix 3.2.1) Keywords: sh csh scripts Message-ID: <1991Feb1.015045.227@sj.ate.slb.com> Date: 1 Feb 91 01:50:45 GMT References: <1991Jan23.225748.23327@sj.ate.slb.com> <8836@star.cs.vu.nl> <1991Jan25.195557.25955@kithrup.COM> <1991Jan29.230217.14825@informix.com> Reply-To: konath@sj.ate.slb.com (Kannan Konath) Organization: Schlumberger ATE, San Jose, CA Lines: 29 In article <1991Jan29.230217.14825@informix.com> aland@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@sj.ate.slb.com