Article View: comp.mail.mush
Article #449Re: MUSH Question
From: Barton E. Schaefer
Date: Fri, 27 Jul 1990 19:12
Date: Fri, 27 Jul 1990 19:12
44 lines
1970 bytes
1970 bytes
On Jul 27, 9:33am, Murray S. Kucherawy wrote:
} Subject: MUSH Question
I hope you don't mind if I carbon my answer to the whole wide world. :-)
} I have a procedure that runs with the -F option on the UNIX command line.
} This procedure has some "pick" and "update" commands in it. This works
} fine, but the only quirk is that new mail appears as "unread" mail when
} the procedure finishes and I display headers.
}
} Can mush be set to mark messages as "new" that are actually new, leaving
} the status of other messages left in the mailbox from a previous session
} alone?
Check out the "flags" command. You can make use of the fact that all
new messages are clumped together at the end of the file. When the
script procedure begins, capture the numbers of the new and old messages,
thusly:
headers -H:n | set new # Can abbreviate as ":n | set new"
* { $new } | set old
Now do all of your "pick" operations. If you do any sorting, restrict
the range of the sort to the new messages:
$new | sort -s # or whatever sort options you want
This way, the value of $old will remain correct even if you update
the folder. After each update, reset $new:
update
* { $old } | set new
As the final operations in your script, restore the "New" status by
using the "flags" command:
$new | flags -O # remove Old flag, leave others alone
Now you can safely sort the entire folder by whatever criteria you
want. Just don't update it again or the new messages will change back
to unread.
--
Bart Schaefer schaefer@cse.ogi.edu
Technical Details
Message-ID:
<9007271912.AA04622@cse.ogi.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!CSE.OGI.EDU!schaeferShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!CSE.OGI.EDU!schaefer From: schaefer@CSE.OGI.EDU (Barton E. Schaefer) Newsgroups: comp.mail.mush Subject: Re: MUSH Question Message-ID: <9007271912.AA04622@cse.ogi.edu> Date: 27 Jul 90 19:12:03 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 44