Article View: comp.unix.shell
Article #258Re: Sort problem . .
From: Michael Lemke
Date: Sun, 02 Aug 1992 05:01
Date: Sun, 02 Aug 1992 05:01
53 lines
2507 bytes
2507 bytes
In article <rsqmjvp.messina@netcom.com> messina@netcom.com (Tony Porczyk) writes:
>Mr. etxmesa@eos.ericsson.se (Michael Salmon) writes:
>> I have seen very many flexible solutions to problems, many of them
>> were even good solutions, for a while at least. The usual result is
>> that some time in the future the flexible solution breaks and someone
>> has to do it right.
>
>Mr. Tom Christiansen <tchrist@convex.COM> writes:
>
>> Hacking on source is almost always a solution that will come back to
>> haunt you. Sometimes things are so broken you have to fix them, but
>> if you just want to munge the output, heroic measures are overkill.
>
>Hm. Okay, maybe we look at it differently. I find modifying source
>to suit my particular need and then saving another version faster and
>*much* easier and more understandable for the future than writing
>wrappers that *should* *usually* work. I don't have to remember to
>wrap the stuff as I use it because it does exactly what I want.
>I don't consider it a heroic solution, I consider it an easy one.
>
>Maybe that would appeal to you more then:
>
>Add one more option, say, "-h" for "header non-sortable", make it
>FALSE by default, TRUE if invoked, and change
>
>printf("%s COMMAND\n", hdr);
>
>to
>
>if(hdr_non_sort)
> fprintf(stderr, "%s COMMAND\n", hdr);
>else
> fprintf(stdout, "%s COMMAND\n", hdr);
>
>It shouldn't take longer than 10-15 minutes to have it completely
>implemented. Isn't it simpler than writing wrappers and remembering
>what needs to be piped through what?
No. You hacked ps. What about w, finger...? Once you got the wrapper
you got them all. You might even got how to attack those which spit out
two header lines....
>No functionality is lost, some
>is added.
Maybe not. Don't know if ps returns a useful exit status but if it does
this will break: ps -some_option >/dev/null || echo 'Warning....'
--
Michael Lemke
Astronomy, UT Austin, Texas
(michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
Technical Details
Message-ID:
<1992Aug2.050145.7158@chpc.utexas.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!aswx266References:
<0fqm1cp.messina@netcom.com> <1992Jul31.115559.11391@convex.com> <rsqmjvp.messina@netcom.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.shell Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!aswx266 From: aswx266@chpc.utexas.edu (Michael Lemke) Subject: Re: Sort problem . . Message-ID: <1992Aug2.050145.7158@chpc.utexas.edu> Organization: The University of Texas System - CHPC References: <0fqm1cp.messina@netcom.com> <1992Jul31.115559.11391@convex.com> <rsqmjvp.messina@netcom.com> Date: Sun, 2 Aug 92 05:01:45 GMT Lines: 53