Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!bbn!bbn.com!cosell From: cosell@bbn.com (Bernie Cosell) Newsgroups: comp.sys.amiga.tech Subject: Re: Dealing with multiple scripting languages (was: Elinating the 'rx' from AREXX) Message-ID: <45815@bbn.COM> Date: 20 Sep 89 12:23:07 GMT References: <721@lpami.wimsey.bc.ca> <1989Aug29.031707.9022@agate.uucp> <7782@cbmvax.UUCP> <4149@sugar.hackercorp.com> <7951@cbmvax.UUCP> Sender: news@bbn.COM Reply-To: cosell@BBN.COM (Bernie Cosell) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 31 In article <7951@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes: }In article shadow@pawl.rpi.edu (Deven T. Corzine) writes: }>peter> I would recommend allowing it in more than just the first line, }>peter> though, since some scripting languages like having the first }>peter> line magic. Also, having some mechanism for passing extra }>peter> arguments to the command interpreter would be useful. }> }>I don't see that this is necessary. It looks to me that the best }>solution is very much like Unix with a slight change. First line, }>"#!" followed by interpreter location and optional args before script }>arg. Stdin of interpreter is set to the script file, starting at the }>SECOND line. That way, you don't have to worry about comment syntax. }>(Granted, it could be a problem if you try to execute the script }>without using the kernal call, then it would start at the first line }>and comment syntax would matter.) } } Most interpreters don't take stdin as input, because (for }example) you may not be able to Seek() stdin (pipes). Seeking is useful }for loops and the like. Not being able to execute it directly from the }interpreter is a big minus, too. Actually, the problems are more significant than that: if you do as Deven suggested then you can't do pipes at all any more (since stdin is now consumed with the script, it cannot be the input from the previous process any more). To really make it all work, you have to establish a standard of having a *fourth* "default" file desciptor open "stdscript". [contrast the difference between doing "cat xxx | sh" and "cat yyy | sh xxx" ] /Bernie\