The name "grep"

Arthur Chance freebsd at
Mon Jul 7 15:06:24 UTC 2014

On 07/07/2014 15:05, Polytropon wrote:
> On Mon, 07 Jul 2014 14:21:04 +0100, Arthur Chance wrote:
>> On 07/07/2014 11:19, Ralf Mardorf wrote:
>>> On Mon, 2014-07-07 at 11:08 +0100, Arthur Chance wrote:
>>>> It's of historical interest, but 30+ years down the line
>>> It still matters as a mnemonic. Everybody understands that "mv" is for
>>> "move". But "grep"? Most of all I like "dd", reminds me of 2001's HAL,
>>> abcd ... hijklm ... yvz, it's negated by the filmmakers, but anyway ...
>>> ^^       ^^  ^^ ... obviously IBM.
>> dd is probably the Unix command I hate most (even though I use it a
>> lot), [...]
> The choice of dd may not sound reasonable today, but when UNIX
> developed, the C compiler was _the_ essential component in order
> to get things running: it was the source of anything else, and
> it existed before anything else. So "copy & convert" couldn't
> be named cc, and dd was usable. Today we have ee ("easy editor")
> and ll (usually an alias for "ls -l" plus often other options).

It's not the name I object to, but the adherence to IBM JCL style 
parameters in a Unix world. The blocking, conversion, etc could have 
just as easily been added to the cp command (or a variant of it) and 
used the familiar command style.

>> [...] just as I hated the original DD directive (and all the rest of
>> JCL) back in the days when I had to use it. There were far better ways
>> of doing things even then.
> But not on systems that ran OS! :-)

At the time when I was seriously working on an IBM machine, I also 
worked on a CDC 7600 and an ICL 190x (can't remember what digit x was at 
this distance). The CDC job control (Scope??) looked like Algol 60 
function calls, and the GEORGE 3/4 command language was remarkably like 
sh (complete with user defined commands). JCL came a very weak third in 
usability or comprehensibility.

>> I've always wondered what the original writer of dd was on when he
>> perpetrated that act of madness. There was Unix, with a relatively clear
>> way of doing things involving -x style options and simple file names and
>> then, ooh, I know what it needs, an invasive alien directive imported
>> from the Big Blue universe, totally unlike anything else in the system.
>> It really should have been
>> 	dd [options] [ infile [ outfile ]]
>> with the options controlling block sizes, conversions, etc.
> Yes, dd is somehow an exception. A syntax like
> 	dd [options] -i infile -o outfile
> would have been imaginable, but its current style
> 	dd [option=value] if=infile of=outfile
> summarized as
> 	dd [operands ...]
> in the manpage, somehow reminds me to JCL if I think of it.
> Allow me to make this clear:

dd was directly based on JCL's DD directive, the original author (whose 
name escapes me) actually liked it and wanted to copy it as far as possible.

> //              UNIT=5065,VOL=SER=USR001,DCB=(BLKSIZE=512,RECFM=F)
> //
> Note that this is so wrong in so much more than the obvious ways. :-)

Yes, so wrong in so many ways. :-)

It's been nearly 40 years now since I last used JCL. There's an IBM 
Handbook (the small ring bound thing that had cheat sheets for almost 
everything IBM-ish) packed away somewhere round the house, but I can't 
remember where exactly. As I remember it was only 10-15 cm wide, but the 
cheat sheet showing all the arguments (and sub-arguments) for DD 
unfolded to about 60 cm.

> There are few other exceptions, for example programs that read
> the list of files to be processed via stdin; cpio is such a program,
> if I remember correctly.

cpio (and xargs) take file names from stdin in order to be used in a 
pipeline with find, which is normal for Unix.

I don't know if you're familiar with this piece from the mid 80s

The bit about the "Perfect Ritual" under Sects still has me laughing as 
I worked on both AT&T and BSD Unices over the years. These days you'd 
have to add the Linux ritual requirements as well.

More information about the freebsd-questions mailing list