Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!olivea!tymix!cirrusl!sunstorm!dhesi From: dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) Newsgroups: comp.mail.mh Subject: Re: scan `pick ...` Message-ID: <2944@cirrusl.UUCP> Date: 12 Feb 91 22:43:10 GMT References: <27B72875.12190@ics.uci.edu> <1501.666374307@note2.nsf.gov> Sender: news@cirrusl.UUCP Organization: Cirrus Logic Inc. Lines: 39 >If the backquoted pick fails, it should return a failure >code. Some shells might still start up the command outside the >backquotes while others do not. When I use scan `pick ...` and the pick fails, the scan still executes but reports no messages. Here is what I see: % scan `pick last:20 -subject xyzzy` pick: no messages match specification scan: no messages match specification Here is what my manual says for "pick": If pick is used in a back-quoted operation, such as scan `pick -from jones` and pick fails (e.g., no messages are from "jones"), then the shell will still run the outer command (e.g., "scan"). Since no messages were matched, pick produced no output, and the argument given to the outer command as a result of backquoting pick is empty. In the case of MH programs, the outer command now acts as if the default `msg' or `msgs' should be used (e.g., "all" in the case of scan ). To prevent this unexpected behavior, if `-list' was given, and if its standard output is not a tty, then pick outputs the illegal message number "0" when it fails. This lets the outer command fail gracefully as well. Compile options for "pick" here are: version: MH 6.6 #1[UCI] (ics) of Tue May 24 15:51:53 PDT 1988 options: [BSD42] [BERK] [TTYD] [MHE] [NETWORK] [BIND] [RPATHS] [SBACKUP='"#"'] [FOLDPROT='"0700"'] [MSGPROT='"0600"'] [MHRC] [MORE='"/user/bin/less"'] [OVERHEAD] [UCI] [UK] [NEED_FCNTL] [SENDMTS] [SMTP] -- Rahul Dhesi UUCP: oliveb!cirrusl!dhesi