0
|
1 % diagram 7
|
|
2
|
|
3 \verbatim
|
|
4 : 'mpick - relate messages /mtr'
|
|
5 PATH=:/bin:/usr/bin:/usr/ucb:/usr/local:/usr/local/lib/mh; export PATH
|
|
6 F="" M="" S=""
|
|
7
|
|
8 for A in $*
|
|
9 do
|
|
10 case $A in
|
|
11 -*) S="$S $A" ;;
|
|
12
|
|
13 +*|@*) case $F in
|
|
14 "") F=$A ;;
|
|
15 *) echo "mpick: only one folder at a time" 1>&2
|
|
16 exit 1 ;;
|
|
17 esac ;;
|
|
18
|
|
19 *) M="$M $A" ;;
|
|
20 esac
|
|
21 done
|
|
22
|
|
23 S="$S -sequence hits -list -nozero"
|
|
24
|
|
25 if mark $F all -add -sequence hits;
|
|
26 then mark $F all -delete -sequence hits;
|
|
27 else exit 1;
|
|
28 fi
|
|
29
|
|
30 for A in ${M-cur}
|
|
31 do
|
|
32 for C in `mhpath $F $A`
|
|
33 do
|
|
34 if [ -r $C ];
|
|
35 then
|
|
36 I=`mhl -form mhl.msgid $C`;
|
|
37 case $I in
|
|
38 "") echo "no message-id in message `basename $C`" 1>&2 ;;
|
|
39 *) pick --in-reply-to "$I" $S ;;
|
|
40 esac
|
|
41 else
|
|
42 echo "message $A doesn't exist" 1>&2; exit 1;
|
|
43 fi
|
|
44 done
|
|
45 done
|
|
46
|
|
47 exit 0
|
|
48 ?endverbatim
|