Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!ODDJOB.UCHICAGO.EDU!matt From: matt@ODDJOB.UCHICAGO.EDU (Matt Crawford) Newsgroups: comp.mail.mh Subject: Re: unrmm command Message-ID: <8806241416.AA04206@oddjob.uchicago.edu> Date: 24 Jun 88 14:16:10 GMT References: <324@helios.ee.lbl.gov> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 32 Here's my unrmm. It's more limited in that it only undeletes the "current" message. ================ #!/bin/sh d=`mhpath` n=`egrep '^cur:' $d/.mh_sequences | awk '{print $2}'` echo $n mv -i $d/\#$n $d/$n ================ And here's a little off-the-cuff mod of Craig's unrmm, using a csh feature and adding the possibility of multiple messages: ================ #!/bin/csh -f if ($#argv == 0) set argv=(`mhpath cur`) set num=0 stat=0 while ($#argv) set new=`mhpath new` set old=$new:h/\#$1 if ( ! -r $old ) then echo "unrmm: deleted message $1 doesn't exist" set stat=1 else mv $old $new @ num++ endif shift end if ( $num ) scan last:$num exit $stat ================ ________________________________________________________ Matt Crawford matt@oddjob.uchicago.edu