Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!jade!violet.berkeley.edu!mwm From: mwm@violet.berkeley.edu (Mike Meyer) Newsgroups: comp.sys.amiga Subject: Shell scripts on AmigaDOS & Unix Message-ID: <2228@jade.BERKELEY.EDU> Date: Fri, 16-Jan-87 05:40:49 EST Article-I.D.: jade.2228 Posted: Fri Jan 16 05:40:49 1987 Date-Received: Sat, 17-Jan-87 00:18:11 EST Sender: usenet@jade.BERKELEY.EDU Reply-To: mwm@violet.berkeley.edu(Mike Meyer) Organization: University of California, Berkeley Lines: 64 I really like shell scripts. I wrote my first shell script for Unix last decade. I've done accounting systems alomst entirely with awk, sed and the shell. I finally sat down and wrote a non-trivial CLI application for AmigaDOS (see the Fish Index posting). I thought I'd comment on the difference between them. Firstly, and most obviously, pipes are relatively new things to Tripos; or so I'd guess. The commands aren't written with the Unix philosophy of expecting your output to go to another program. They're cluttered with extraneous garbage (useful to look at, but not to process). Also, the lack of a real stream editor was painfully obvious, forcing me descend to C code at one point (trivial program, but still.....). On the other hand, that pipes exist in the AmigaDOS name space, instead of being anonymous, is a MAJOR win. For instance, I've got one invocation of edit that takes the file to be edited from one pipe, the edit commands from a second, and puts it's output on a third. This is NOT doable on Unix (if it is, *let me know how* - I've wanted to do this type of things several times!). [Ok, I think I can see how to do it, if you have either v8, or one of the /dev/fd hacks in your kernel. May have to go try it....]. Obviously, this kind of thing could be added to Unix, and has in part with the ever-popular /dev/stdin and /dev/stdout pseudo devices (from v8; you can get source for it for either 4.2 or 4.3 from me). Sys V may even have it in full; I'm not sure what "named pipes" constitute. The query to my SysV wizard has gone out in the mail. In summary, Unix is a nicer place to write shell scripts, because the tool set has been designed for using pipes. It's also easier to start a pipe from the shell (fixable by re-writing the shell for AmigaDOS, of course!). If suitable tools got built for AmigaDOS, I think it'd be better, just because pipes are in the file namespace. Oh, yeah - you also get the equivalent of /dev/stdin and /dev/stdout on AmigaDOS for free, in the filename "*". One odd things is that the tools for the two systems should be DIFFERENT. On Unix, everything should read from stdin by default, and write to stdout by default. On AmigaDOS, since pipes are filenames, you want things to have "from" and "to" filenames. Obviously, you can make tools from Unix work in AmigaDOS by doing "tool >pipe:out