Gripes about /bin/sh AND /bin/csh (or, Phil's on his soapbox)

Phil Pfeiffer pfeiffer at uwvax.UUCP
Thu Jun 5 04:58:56 AEST 1986


I'm posting this message in reponse to a request from a fellow UW student.
This comes from a novice Unix user.  Maybe some other people in the
unix community could prove to me that these gripes are really non-gripes.

I'm trying to do some extensive rapid prototyping in shellish right now, and
I'm having a hard time saying what I want I want to in shell script.
I never thought I'd say this, but I actually  *miss*  the DEC standard
11-series command interpreters!   First, there's the bit about brain-damaged
quoting (or, non-quoting) of metacharacters.   I'm sure a lot of you already
know that the ability to use backquote to expand certain command strings
just isn't there.  'Twould be useful if one could abbreviate commands as
variables to make one's code more legible, a la lisp.

That's irritating.  What's really irritating, however, is the inability to
open and read multiple files from the shell.  I mean, even RSX-11M's CSI has
this!  I received one response locally that, if this is what I want to do,
then I ought to write a C-program.  But I don't *want* to write a c-program
just now -- I just want to prototype something that will work and can be
easily changed.  Also, this utility may never need to be cast in C, anyway,
since it doesn't have to work quickly.

The requirement was as follows:
	generate several command files to apply a certain sequence of commands
	(a template, as it were) to each element in a series of lines in another
	file.  The templates also had to include expanded shell variables
	(names of temp files, actually),  which ruled out easy use of "awk".

I finally wound up creating, on the fly, a command file to expand templates.
The templates were then used as command files to create the body of the
command file that I really wanted (which will end up being exported to another
host, and executed using rsh).

Somehow, it just doesn't seem right that command files to create command files
to generate command files should be the clearest way of doing things.





-- 
-- Phil Pfeiffer

...!{harvard,ihnp4,seismo,topaz}!uwvax!pfeiffer
(608) 263-7308



More information about the Comp.unix mailing list