From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9590 invoked from network); 2 Sep 2005 15:34:42 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Sep 2005 15:34:42 -0000 Received: (qmail 80358 invoked from network); 2 Sep 2005 15:34:30 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Sep 2005 15:34:30 -0000 Received: (qmail 6930 invoked by alias); 2 Sep 2005 15:34:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9365 Received: (qmail 6921 invoked from network); 2 Sep 2005 15:34:23 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Sep 2005 15:34:23 -0000 Received: (qmail 79411 invoked from network); 2 Sep 2005 15:34:23 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 2 Sep 2005 15:34:19 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-2.05 (built Apr 28 2005)) with ESMTPA id <0IM70029Z4L4CD10@vms046.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 02 Sep 2005 10:34:17 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j82FYFn0022485 for ; Fri, 02 Sep 2005 08:34:15 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j82FYEHT022484 for zsh-users@sunsite.dk; Fri, 02 Sep 2005 08:34:14 -0700 Date: Fri, 02 Sep 2005 15:34:14 +0000 From: Bart Schaefer Subject: Re: Silent shell but not silent script In-reply-to: <20050902110911.GA158@DervishD> To: Zsh Users Message-id: <1050902153414.ZM22483@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050902110911.GA158@DervishD> Comments: In reply to DervishD "Silent shell but not silent script" (Sep 2, 1:09pm) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Sep 2, 1:09pm, DervishD wrote: } } Sometimes the command I have to run won't exist, so zsh will } issue that error. How the heck can I make zsh not to spill the error } message but at the same time let the command to use stderr and } stdout? As far as I can tell, it's impossible. Redirections are done *before* the command execution is attempted, which is why this ... } $ ./command 2> /dev/null ... succeeds in suppressing the error message. But that also means that this ... } $ { ./command 2>&1 } 2> /dev/null ... does *not* succeed in suppressing the error, it only succeeds in sending the error to stdout. } The only solution I've found so far is to pipe stderr thru a sed } script and get rid of any shell message I'd have suggested 'grep -v "^zsh:"', or egrep with a more specific set of messages to suppress.