home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3173 < prev    next >
Encoding:
Text File  |  1992-07-28  |  1.3 KB  |  31 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!munnari.oz.au!bruce.cs.monash.edu.au!merlin!cerberus!cerberus!Sm
  3. From: Sm@cerberus.bhpese.oz.au (Scott Merrilees)
  4. Subject: Re: Sort problem . .
  5. Organization: BHP, Newcastle, Australia
  6. Date: Wed, 29 Jul 1992 04:46:00 GMT
  7. Message-ID: <1992Jul29.044600.27445@cerberus.bhpese.oz.au>
  8. References: <1992Jul27.123415.977@leland.Stanford.EDU> <1992Jul27.140110.846@news.eng.convex.com> <1992Jul28.095415.4640@prl.dec.com> <1992Jul28.102938.12375@news.eng.convex.com>
  9. Sender: news@cerberus.bhpese.oz.au (News System)
  10. Lines: 19
  11.  
  12. Tom Christiansen <tchrist@convex.COM> writes:
  13.  
  14. >From the keyboard of boyd@prl.dec.com (Boyd Roberts):
  15. >:In article <1992Jul27.140110.846@news.eng.convex.com>, Tom Christiansen <tchrist@convex.COM> writes:
  16. >:> ps axu | ( sed 1q ; sort -nr +3 ) 
  17. >:Eh?  Since when does sed do `unbuffered' reads?
  18. >:Nice idea though...
  19. >Hey -- it surprised the heck out of me too!  But it did indeed work
  20. >without losing lines on a test run.  Unforunately, I ran but one test, 
  21. >and must have just gotten lucky, cause now I lose lines.
  22. >This does seem to work:
  23. >    ps axu | (read line; echo "$line"; sort +3rn) 
  24.  
  25. ps axu | sed 1d | sort -nr +3
  26.  
  27. Sm
  28. -- 
  29. Scott Merrilees, BHP Information Technology, Newcastle, Australia
  30. Internet: Sm@bhpese.oz.au   Phone: +61 49 40 2132   Fax: ... 2165
  31.