chiark / gitweb /
Initial commit as found
[modbot-ulm.git] / stump / local / bin / pmnewsgroups
1 #!/bin/sh
2
3 # @(#)pmnewsgroups      1.3 (PGP Moose) 95/11/13
4 # Return sorted list of newsgroups in message
5 sed -n -e '/^[Nn][Ee][Ww][Ss][Gg][Rr][Oo][Uu][Pp][Ss]:/,/^[^    ]/p' \
6         -e '/^[         ]*$/q' \
7         $* \
8     | sed -e 's/^[Nn][Ee][Ww][Ss][Gg][Rr][Oo][Uu][Pp][Ss]:[     ]*/ /' \
9         -e '/^[^        ]/d' \
10         -e 's/^[        ]*//' \
11         -e 's/[         ]*$//' \
12         -e 's/,[        ]*/\
13 /g' \
14     | tr "[A-Z]" "[a-z]" \
15     | sort \
16     | sed -e '/^[       ]*$/d'