Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!stanford.edu!agate!ucbvax!metolius.wr.tek.COM!jamesp From: jamesp@metolius.wr.tek.COM (James T Perkins) Newsgroups: comp.mail.mh Subject: Re: Using Unseen to check for new mail Message-ID: <9103072018.AA12084@metolius.WR.TEK.COM> Date: 7 Mar 91 20:18:52 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "James T. Perkins" Organization: The Internet Lines: 33 Howdy Shannon (Traveller Mailing List subscriber!), Very simply, you could say: sh -c "scan +inbox unseen 2>/dev/null" Which sends the error output to the bitbucket. It depends on /bin/sh to redirect stderr without redirecting stdout (one of things csh doesn't do without major frustration). You could make this more indirect using csh only, with: mhpath +inbox unseen >&/dev/null if ($status == 0) scan +inbox unseen Or something like that. The mhpath lists out the pathnames of the messages in unseen, and sends them to the bitbucket. It sets csh variable status to 0 (success) if there is at least one unseen message, and to 1 (error) if there are no unseen messages (the error message, identical to scan's, has been redirected to the bitbucket). The if tests whether the mhpath suceeded or failed. if it suceeded (at least one message), it runs scan on the unseen messages. James (Traveller Mailing List Admin) ___ ___ ___ | \ / _ \ / __| James Perkins, jamesp@metolius.wr.tek.com, (503)629-1149 | |> || |_| |\__ \ Logic Analyzers Division, DAS 9200 Engineering |___/ |_| |_||___/ Tektronix, MS 92-725, PO Box 4600, Beaverton, OR 97076 This package is sold by weight, not by volume. Some settling of contents may have occurred during shipping and handling.