#!/bin/sh # # Searches subjects in news articles for a regular expression # [ $# -lt 2 ] && { echo "usage: ss groups pattern" >&2; exit 1; } readnews -i -l -n "$1" | nawk ' /^ [^ ]/ { title = $0; next } /'"$2"'/ { if (title) { print title; title = "" }; print }' | ${PAGER:-more} .