#!/bin/bash # author: Christian Pietsch # url: http://www.dfki.de/~pietsch/software/ # created: Tue Jul 31 14:00:32 2001 (MEST) # version: $Id: grepine,v 1.3 2001/07/31 12:29:50 cb Exp cb $ # purpose: search Pine mail folders and display results in a temporary folder # # Copyright (c) Christian Pietsch, 2001. # Freely distributable under the terms of, ahem, the Artistic License # (see http://www.perl.com/language/misc/Artistic.html ) # # I am not liable for any damage caused by this software. # You may be able to delete all information on you hard disk # if you try hard enough. MAILDIR=~/mail if [ $# == 0 ]; then echo echo "usage: just like grepmail except results are displayed" echo " in a temporary Pine folder" echo exit 2 fi CURWD=$(pwd) cd ${MAILDIR} TMPFILE=$(mktemp ${MAILDIR}/grepine.XXXXXX) || exit 1 grepmail "$@" > $TMPFILE pine -i -f $TMPFILE rm -f $TMPFILE cd $CURWD