#!/bin/sh

# @(#)pmnewsgroups	1.3 (PGP Moose) 95/11/13
# Return sorted list of newsgroups in message
sed -n -e '/^[Nn][Ee][Ww][Ss][Gg][Rr][Oo][Uu][Pp][Ss]:/,/^[^ 	]/p' \
	-e '/^[ 	]*$/q' \
	$* \
    | sed -e 's/^[Nn][Ee][Ww][Ss][Gg][Rr][Oo][Uu][Pp][Ss]:[ 	]*/ /' \
	-e '/^[^ 	]/d' \
	-e 's/^[ 	]*//' \
	-e 's/[ 	]*$//' \
	-e 's/,[ 	]*/\
/g' \
    | tr "[A-Z]" "[a-z]" \
    | sort \
    | sed -e '/^[ 	]*$/d'


syntax highlighted by Code2HTML, v. 0.9.1