Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cmcl2!beta!hc!ames!oliveb!jerry From: jerry@oliveb.UUCP (Jerry F Aguirre) Newsgroups: comp.unix.questions Subject: Re: Why does this shell program run under csh??? Message-ID: <1615@oliveb.UUCP> Date: Thu, 25-Jun-87 16:25:53 EDT Article-I.D.: oliveb.1615 Posted: Thu Jun 25 16:25:53 1987 Date-Received: Sat, 27-Jun-87 03:51:34 EDT References: <7953@brl-adm.ARPA> <6014@brl-smoke.ARPA> Reply-To: jerry@oliveb.UUCP (Jerry F Aguirre) Organization: Olivetti ATC; Cupertino, Ca Lines: 35 In article <6014@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <7953@brl-adm.ARPA> MCGUIRE%GRIN2.BITNET@wiscvm.wisc.EDU writes: >>For example: .../myshell.sh would be run under sh, but .../myshell.csh >>would be run under csh. > >things compiled right. No way am I going to edit a zillion Makefiles >to redefine "cc" to "cc.sh", then later change them back. (Admittedly I think the suggestion implied that the various programs would automatically look for the file with the recognized extensions. Thus if you type "cc" the shell (including the one invoked by the make command) would first look for "cc.sh", then "cc.csh", and finally a binary executable program of "cc". This is the way it works on other systems and it is really no more bizzare than the PATH variable that says first check for "/bin/cc", then "/usr/bin/cc", etc. One is adding prefixes while the other is adding suffixes. Having it check for shell scripts first is convenient as you can write a "cc.sh" that invokes the "cc" program with special arguments. On Unix you are forced to use two different names or hope that the PATH finds the script first. Other systems also have file types that can be used to accomplish the same thing. Types are assigned for binaries, command files, Basic programs, etc. What is really interesting is that other systems usually have both extensions and file types and different utilities will use one or the other to decide if a file is of a particular sort. By example under DG AOS if "foo.cli" doesn't have the file type "CLI command file", it will still run. But, if "foo.pr" doesn't have the type of "executable program" it won't run. Jerry Aguirre