Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!olivea!uunet!sjsca4!konath From: konath@sj.ate.slb.com (Kannan Konath) Newsgroups: comp.unix.sysv386 Subject: sh and csh scripts (SCO ODT 1.0 with SCO Unix 3.2.1) Keywords: sh csh scripts Message-ID: <1991Jan23.225748.23327@sj.ate.slb.com> Date: 23 Jan 91 22:57:48 GMT Reply-To: konath@sj.ate.slb.com (Kannan Konath) Organization: Schlumberger ATE, San Jose, CA Lines: 29 I have a few shell scripts that are either csh (C shell) or sh (Bourne shell) scripts. However the facility of specifying the type of script, that is available in the Berkeley/SunOS environement (ie. #!/bin/csh or #!/bin/sh), does not seem to work in SCO ODT (SCO Unix). I have two questions: a) Is this the way System V R3 executes scripts or is it a bug in SCO Unix? Is "#!/bin/" in a shell script understood by SysVR3. b) Is there any way for me to run these scripts automatically without having to resort to "csh " or "sh " and given that my default shell could be either one of the shells, ie., csh or sh. One clumsy method that I did think of using was to have two files. Assume the shell script is to be called SHELLscr, then have two files SHELLscr and one of SHELLscr.csh or SHELLscr.sh. The file SHELLscr just contains one line "csh SHELLscr.csh" or "sh SHELLscr.sh" depending on the type of shell script. I haven't tried this but it should work. kannan konath@sj.ate.slb.com