view miscellany/mtrenv/bin/mpick @ 17:76d91e545ea8 default tip

addrsbr and dtimep fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 24 Nov 2014 14:49:25 +0900
parents bce86c4163a3
children
line wrap: on
line source

: run this script through /bin/sh
: PATH=:/bin:/usr/bin:/usr/ucb:/usr/uci:/usr/uci/lib/mh; export PATH
F="" M="" S=""

for A in $*
do
    case $A in
	-*)	S="$S $A" ;;

	+*|@*)  case $F in
		    "")  F=$A ;;
		    *)	 echo "mpick: only one folder at a time" 1>&2
			 exit 1 ;;
		esac ;;

	*)	M="$M $A" ;;
    esac
done

S="$S -sequence hits -list -nozero"

if mark $F all -add -sequence hits;
    then mark $F all -delete -sequence hits;
    else exit 1;
fi

for A in ${M-cur}
do
    for C in `mhpath $F $A`
    do
	if [ -r $C ];
	    then
		I=`mhl -form mhl.msgid $C`;
		case $I in
		    "")	 echo "no message-id in message `basename $C`" 1>&2 ;;
		    *)	 pick --in-reply-to "$I" $S ;;
		esac
	    else
		echo "message $A doesn't exist" 1>&2; exit 1;
	fi
    done
done

exit 0