The Visible Cat

cottrell at nbs-vms.ARPA cottrell at nbs-vms.ARPA
Fri Mar 1 09:32:57 AEST 1985


> What kind of thinking?  The notion that the availability of N options
> in "cat" is what makes 4.2BSD great?  Sorry, 'taint so.  A simple
> linenumbering utility ("simple" here excludes "nl" - does anybody actually
> use all the subsubsubsubsection stuff there?) does the job of "cat -n"
> quite nicely, and a simple visual display utility does the job of "cat -v"
> equally well.  Putting both those functions into "cat" makes as much sense
> as putting file copying, file deleting, file renaming, directory listing,
> etc., etc. into a program named, for the sake of argument, "PIP".
> 
> Besides, System V has, unfortunately, picked up "cat -v".
> 
> 	Guy Harris
> 	{seismo,ihnp4,allegra}!rlgvax!guy

I am referring to the extreme notion that if cat is to retain its 
pedigree as a `pure unix tool' that it must have no other funxion but
the simple concatenation of files. This is the Moral Equivalent Of War!
(MEOW :-) Why was the notion of options invented? To do the same thing
just a little bit differently. That's what I want to do.

Let's say I want to look at some mostly-printable but slightly-
infected-by-control-character ascii files, number please. I do
cat -nv file. Doing it your way would require:

	cat file | num | vis

This loads three programs and runs the data thru two pipes. Yuk!
>From the user's point of view, `cat' is what the user types
to type his file. Let's get User Friendly (user friendly), I wanna get...
This poor guy would like to type `type file...'. I realize this is
`just a special case' but it's the most common usage for most users.

Axually, tho, you are right, but not for the reasons stated by you or
even DMR. Having thought about it, I realize there is a better way.
In its pure form, cat can use read's & write's. No need to look at every
char. The -v option belongs in `pr', which is already a formatting
program. It already does -n. Recondition ourselves to use pr
instead of cat. However, the default should be to always make funny
chars visible, and use -v to output verbatim. Pr is mostly used to
send things to the printer, which barfs at control chars anyway.

Saying things like putting in features just makes the manual thicker
does not communicate your reasoning to someone who likes a particular
feature. As I said, we can get rid of `cp' by using `cat <from >to'.
However, if one is going to argue against a specific implementation
of a feature, one must be prepared to offer it somewhere else.

My SYS V (Motorola port, V.0) has no cat -v. It has no pg either. TPC
dragged their feet on any kind of screen editor and still does not
have csh or the multicolumn ls that DMR railed against. It was 
instructive to read his thoughts on multicolumn filters and in fact I
wrote /bin/lm that contains the line `ls $* | pr -at5'. While I can
see that features for features sake is cancerous, lack of funxionality
is annoying, user hostile, and just plain boring. Joe Random Hacker
(he's back, folx!) wants to see his files in a pretty-printed format,
he doesn't care that the ouput can be piped to grep or sed in a
one-file-per line format. Tools should serve their masters.

"Use your mentality, wake up to reality"

	jim
*/



More information about the Comp.unix.wizards mailing list