home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: Sort problem . .
- Message-ID: <1992Jul28.102938.12375@news.eng.convex.com>
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Nntp-Posting-Host: pixel.convex.com
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- Organization: CONVEX Realtime Development, Colorado Springs, CO
- References: <1992Jul27.123415.977@leland.Stanford.EDU> <1992Jul27.140110.846@news.eng.convex.com> <1992Jul28.095415.4640@prl.dec.com>
- Date: Tue, 28 Jul 1992 10:29:38 GMT
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 33
-
- From the keyboard of boyd@prl.dec.com (Boyd Roberts):
- :In article <1992Jul27.140110.846@news.eng.convex.com>, Tom Christiansen <tchrist@convex.COM> writes:
- :>
- :> ps axu | ( sed 1q ; sort -nr +3 )
- :>
- :
- :Eh? Since when does sed do `unbuffered' reads?
- :
- : prl313 ; @{echo 1 ; echo 2 ; echo 3} | @{sed 1q ; cat}
- ^^ ^^^^^^
- Sure looks like perl to me. :-)
-
- :Nice idea though...
-
- Hey -- it surprised the heck out of me too! But it did indeed work
- without losing lines on a test run. Unforunately, I ran but one test,
- and must have just gotten lucky, cause now I lose lines.
-
- This does seem to work:
-
- ps axu | (read line; echo "$line"; sort +3rn)
-
- I really loathe stdio sometimes, but I'm sure we're stuck with it
- until the end of time. The buffering on both reading and writing
- needs to be controllable without modifying the program or tricking
- it into thinking you're a tty.
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
-
- "* Unix is a footnote of AT&T Bell Laboratories."
- --Barry Shein
-