Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830713); site hwcs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!ukc!edcaad!hwcs!jim From: jim@hwcs.UUCP (Jim Crammond) Newsgroups: net.unix-wizards Subject: Re: Fun With #! Lines Message-ID: <121@hwcs.UUCP> Date: Sun, 19-Aug-84 04:12:23 EDT Article-I.D.: hwcs.121 Posted: Sun Aug 19 04:12:23 1984 Date-Received: Thu, 9-Aug-84 04:48:15 EDT References: <7977@umcp-cs.UUCP> Organization: Computer Sci., Heriot-Watt U., Scotland Lines: 16 I have a file called 'todo' which begins with the line #!/usr/ucb/vi +2vi Thus if I execute it, it vi's itself. The +2 is so it starts on the second line, the 'vi' forces it into visual mode as it goes into open mode otherwise, (a feature I presume). Perhaps more useful is the way I've heard it is used in MU-Prolog: When the MU-Prolog interpreter saves the program currently in memory it dumps various structures into a file preceded by a #!/usr/..../muprolog Thus the saved file can be executed directly, it automatically calls up the interpreter to read itself in and execute. -Jim Crammond. ..!ukc!edcaad!hwcs!jim