Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!gatech!hao!husc6!cmcl2!brl-adm!adm!MCGUIRE%GRIN2.BITNET@wiscvm.wisc.EDU From: MCGUIRE%GRIN2.BITNET@wiscvm.wisc.EDU Newsgroups: comp.unix.questions Subject: Why does this shell program run under csh??? Message-ID: <7953@brl-adm.ARPA> Date: Mon, 22-Jun-87 20:57:22 EDT Article-I.D.: brl-adm.7953 Posted: Mon Jun 22 20:57:22 1987 Date-Received: Tue, 23-Jun-87 07:24:40 EDT Sender: news@brl-adm.ARPA Lines: 25 > Date: Tue, 16 Jun 87 18:01:35 EDT > From: Root Boy Jim > Subject: Why does this shell program run under csh???? > > Obviously, *some* attempt must be made to determine which shell to use. > And that complicates matters. One must conform or get bitten. > The environment variable SHELL comes to mind, but is quickly discarded. > The information must be *in the script itself*. The #! convention is > (a start at) a good general solution, as there are bound to be more > than two shells, just as there are bound to be more than one. > > How would you distinguish which shell to run? Disclaimer: I grok VMS, and I'm just learning UNIX. I'm submitting this because somebody will undoubtedly correct me, and I'll learn something. Why couldn't the file's name be used to determine what shell to use? Such a convention ought to be easy to implement in the kernel. In a manner of speaking, the information would be `in the script itself' because the filename is the unique key that locates the file contents. For example: .../myshell.sh would be run under sh, but .../myshell.csh would be run under csh. Ed