Path: utzoo!utgpu!watserv1!watmath!att!dptg!mtung!luke From: luke@mtung.ATT.COM (S. Luke Jones) Newsgroups: comp.unix.questions Subject: sorting (using sort/sed/awk/whatever) Message-ID: <2943@mtung.ATT.COM> Date: 2 Aug 90 19:04:19 GMT Reply-To: luke@mtung.ATT.COM (S. Luke Jones) Distribution: na Organization: Bob's House of Programs Lines: 25 Here's a brain teaser for you UNIX tool-and-shell gurus out there. My news-reader presents articles in the order they appear in my .newsrc file. How can I sort it by subject? (I don't want to do it by hand because it seems like there's two or three new newsgroups a day.) If I just sort (no options) my .newsrc I get something like comp.lang.c++: comp.zillions.of.other.things: comp.std.c++: sci.random.stuff: rec.c++: talk.bizarre: talk.politics.oop.c++: and so forth. The articles on (C++) are not clumped together the way I want them. But because the c++ appears at a different depth in the name of each newsgroup, sort -t. +5 -6 +4 -5 +3 -4 +2 -3 +1 -2 .newsrc > puke won't work either. What am I missing? Surely there's got to be an easy way to do this. Suggestions? -- Luke Jones, luke@mtung.att.com, ...!att!mtung!luke, phone 201/957-2733 Notworked Software Laboratory, Computer Systems Division, Bell Laboratories Disclaimer: the opinions are mine but I had to sign away my rights to them. Quote: "System Test? That's for *idiots*!" (paraphrasing Insp. H. Calahan)