Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: Why does this shell program run under csh??? Message-ID: <7223@mimsy.UUCP> Date: Fri, 26-Jun-87 22:21:59 EDT Article-I.D.: mimsy.7223 Posted: Fri Jun 26 22:21:59 1987 Date-Received: Sat, 27-Jun-87 12:37:37 EDT References: <7953@brl-adm.ARPA> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 32 In article <7953@brl-adm.ARPA> MCGUIRE%GRIN2.BITNET@wiscvm.wisc.EDU writes: >>How would you distinguish which shell to run? >Why couldn't the file's name be used to determine what shell to use? You could. But consider what happens if you do. >Such a convention ought to be easy to implement in the kernel. Not that easy, for names are forgotten as soon as possible; but not hard. So say we taught the kernel that `.sh' meant /bin/sh, and `.csh' meant /bin/csh. That would mean that no programs could ever be named `foo.sh' (no great loss), and that all shell scripts would have to be named foo.sh or foo.csh (somewhat annoying---who *cares* whether lpr is a shell script or a binary or whatever). It would also mean that after you wrote your FOOGOL interpreter, you would have to rebuild the kernel to know that `.foogol' meant /usr/mcguire/bin/foogol.interp, and then after your friend wrote his BARGOL based on your FOOGOL, that you would have to rebuild it again. Of course, you could put a configurable table inside the kernel that could be loaded at boot time. But then you would have to be privileged to alter the table, just as you have to be privileged to rebuild the kernel; and your favourite extension might have already been taken; and lots of other things. Using `#! /usr/mcguire/bin/foogol.interp' seems so much simpler, and more flexible, although it does require that FOOGOL allow `#! /usr/mcguire/bin/foogol.interp' as the first line of a FOOGOL program. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: seismo!mimsy!chris