Article View: news.software.readers
Article #43307Re: How can I sort newsgroups?
From: Joerg Uecker
Date: Sat, 19 Sep 1998 00:00
Date: Sat, 19 Sep 1998 00:00
54 lines
1945 bytes
1945 bytes
<admin@intergrafix.net> wrote:
> Is there any way to get it to sort my newsgroup list alphabetically (either
> ascending or descending)?
Here ist another sripts for doing this:
#! /bin/sh
# Sorts the users's .newsrc as specified.
# Usage: groupsort [name1] [name2] ...
# Found on Usenet, original author unknown (to jtbell@presby.edu, anyway).
sort -o newnewsrc $HOME/.newsrc
# Alphabetized version of .newsrc temporarily saved as newnewsrc.
# Now put specified groups first, save as new .newsrc.
#
# For example, 'groupsort news.software news.admin news rec talk soc'
# sorts everything, then picks out groups beginning with news.software,
# then news.admin, then all news.* groups, then rec.*, talk.*, soc.*,
# in that order, and puts them at the top.
#
# Be sure to make this file executable: 'chmod +x groupsort'.
rm -f right left
touch right
for g in $* ; do
egrep "^$g" newnewsrc >> right
egrep -v "^$g" newnewsrc > left
mv -f left newnewsrc
done
cat right newnewsrc > left
mv -f left newnewsrc
rm right
egrep "^options " newnewsrc > right
egrep -v "^options " newnewsrc > left
mv -f left newnewsrc
egrep -v '!' newnewsrc >> right
egrep '!' newnewsrc > left
cat right left > newnewsrc
rm right left
mv -f $HOME/.newsrc $HOME/.oldsrc # Make a backup!
mv newnewsrc $HOME/.newsrc
--
J"org Uecker <ju@pirx.ruhr.de>
Technical Details
Message-ID:
<ezi8yw.66@pirx.ruhr.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailReferences:
<6ttnrf$d5d$1@ns2.intergrafix.net>Show Full Headers
Complete Article Headers
Message-ID: <ezi8yw.66@pirx.ruhr.de> Subject: Re: How can I sort newsgroups? Date: Sat, 19 Sep 1998 00:00:00 +0000 From: ju@pirx.ruhr.de (Joerg Uecker) References: <6ttnrf$d5d$1@ns2.intergrafix.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 392817463 Organization: Private Site Newsgroups: news.software.readers