cat -u

Mike Haertel mike at thor.stolaf.edu
Tue Dec 13 04:04:55 AEST 1988


In article <5077 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>By the way, if you took the one-function-per-program philosophy too far,
>you would have separate commands such as cc-g, cc-O, cc-ld, cc-E, etc.,
>instead of having a single front-end called cc that accepts a large
>number of switches.

Nobody ever said programs should have really only ONE function.  But all
of a program's options should be related to its main purpose.  Cat -v,
for example, fails this test, because making nonprinting characters
visible has nothing whatever to do with concatenating files.  Cat -u
is merely cruft.  Cat -s is not portable between BSD and System V;
on BSD you can replace it with "sed '/^$/d'" and on System V it
means about the same as 2>/dev/null.  So -s is disposable too.
IMHO, cat needs no options.

The -g option to compilers, on the other hand, is intimately related
to the internals of the compiler, and there is no clean way to make
it in a separate program.

#ifdef FLAME
Just because it is more 'efficient' to combine functionality in one
program (is it really?  Think of debugging time . . .) doesn't mean
you should.  Defending something like cat -s?  You're nuts.  I suppose
you want a -t option to cat, to transliterate characters in its output
too . . . or maybe a -e option, to expand tabs . . . or . . .
#endif
-- 
Mike Haertel					mike at wheaties.ai.mit.edu
			In Hell they run VMS.



More information about the Comp.unix.wizards mailing list