Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!caip!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!whuxl!mike From: mike@whuxl.UUCP (BALDWIN) Newsgroups: net.unix,net.unix-wizards Subject: Re: Gripes about /bin/sh AND /bin/csh (or, Phil's on his soapbox) Message-ID: <1143@whuxl.UUCP> Date: Sun, 8-Jun-86 22:15:08 EDT Article-I.D.: whuxl.1143 Posted: Sun Jun 8 22:15:08 1986 Date-Received: Tue, 10-Jun-86 03:27:25 EDT References: <931@uwvax.UUCP> Organization: AT&T Bell Laboratories, Whippany Lines: 51 Xref: linus net.unix:7387 net.unix-wizards:15273 > First, there's the bit about brain-damaged >quoting (or, non-quoting) of metacharacters. I don't know what you're getting at here. > I'm sure a lot of you already >know that the ability to use backquote to expand certain command strings >just isn't there. SVR2 /bin/sh does this right. Pre-SVR2 had problems with the output of builtin commands (set, export, etc). You couldn't redirect them or put them in back-quotes the ordinary way. > 'Twould be useful if one could abbreviate commands as >variables to make one's code more legible, a la lisp. With SVR2 /bin/sh you just set up a shell function: foo() { command I want to run; } and say foo Pre-SVR2 you can set up a shell var: foo='command I want to run' and say eval $foo > What's really irritating, however, is the inability to >open and read multiple files from the shell. You must've missed the sections on redirection and "exec" in /bin/sh. The Bourne shell has always handled this rather cleanly! To open 3 files (as fd's 3 4 5) and read/write stuff to them: exec 3output # open files while read file <&3 # read from fd3 do x=`line <&4` # read from fd4 (echo $file: $x $x) >&5 # write to fd5 done exec 3<&- 4<&- 5>&- # close files The C shell doesn't deal with file descriptors at all. Try to get an SVR2 /bin/sh; I think it's the best of the standard shells. -- Michael Baldwin (not the opinions of) AT&T Bell Laboratories {at&t}!whuxl!mike