Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / miscellany / mtrenv / bin / sscan
1 : run this script through /bin/sh
2
3 if mhpath all > /dev/null; then true; else exit 1; fi
4
5 if [ "x$1" = x ]; then
6     S=`scan -format %subject first`
7     if [ "x$S" = x ]; then mark -add -zero -sequence select first; fi
8 else
9     S="$1"
10 fi
11
12 if [ "x$2" != x ]; then echo 'usage: sscan [subject]' 1>&2; exit 1; fi
13
14 if [ "x$S" != x ]; then
15     S=`echo $S | tr A-Z a-z | sed -e 's%^re:%%' | sed -e 's%^[  ]*%%'` 
16     if pick -subject "$S" -zero -sequence select; then true; else exit 1; fi
17 fi
18
19 sortm select; scan select
20
21 exit 0