From: Sven G. <gu...@ma...> - 2002-05-28 02:46:15
|
* John Iverson <jo...@fl...> [2002-05-26 23:05]: > Yeah, but I was just looking for a way to keep a list of only my > subscribed groups (1 or 2 kbytes), instead of all groups (almost > 800 kbytes for me), and then merge that back into a fresh .jnewsrc. $ cp $HOME/.jnewsrc $HOME/.jnewsrc.bak $ grep : $HOME/.jnewsrc > $HOME/groups-sub $ grep ! $HOME/.jnewsrc > $HOME/groups-unsub $ cat $HOME/groups-sub $HOME/groups-unsub > $HOME/.jnewsrc but i prefer to delete the unsubscribed newsgroups directly within vim: vim -c 'g:!:d' -c 'wq' $HOME/.jnewsrc > > :g/:/move 0 > Cool! Good tip! it's a simple :global command. *shrug* and assuming that all subscribed groups are already at the top of the file and that there is at least one unsubscribed newsgroup following (a line with an '!´) you can easily sort the subscribed groups with this command: :1,/!/-!sort "from the first line unto a line which contains an exclamation mark (go back one line) pipe them all through 'sort'." and, of course, the input is replaced by output of the command. easy. :-) Sven [04:45am zzzZZZ] |