From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16319 invoked from network); 2 Sep 2005 16:00:04 -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 16:00:04 -0000 Received: (qmail 1306 invoked from network); 2 Sep 2005 15:59:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Sep 2005 15:59:55 -0000 Received: (qmail 12915 invoked by alias); 2 Sep 2005 15:59:48 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9366 Received: (qmail 12904 invoked from network); 2 Sep 2005 15:59:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Sep 2005 15:59:47 -0000 Received: (qmail 311 invoked from network); 2 Sep 2005 15:59:47 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 2 Sep 2005 15:59:42 -0000 Received: from 212.red-80-35-44.pooles.rima-tde.net ([80.35.44.212]:32793 helo=localhost) by ns9.hostinglmi.net with esmtpa (Exim 4.52) id 1EBDxA-0004gV-KJ; Fri, 02 Sep 2005 17:59:44 +0200 Date: Fri, 2 Sep 2005 18:03:50 +0200 From: DervishD To: Bart Schaefer Cc: Zsh Users Subject: Re: Silent shell but not silent script Message-ID: <20050902160350.GA898@DervishD> Mail-Followup-To: Bart Schaefer , Zsh Users References: <20050902110911.GA158@DervishD> <1050902153414.ZM22483@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1050902153414.ZM22483@candle.brasslantern.com> User-Agent: Mutt/1.4.2.1i Organization: DervishD X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns9.hostinglmi.net X-AntiAbuse: Original Domain - sunsite.dk X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - dervishd.net X-Source: X-Source-Args: X-Source-Dir: 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.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 Hi Bart :) * Bart Schaefer dixit: > 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. That's what I suppose :( > Redirections are done *before* the command execution is attempted, > which is why this ... Yes, I've noticed from the shell error message suppression. > } 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. Is it faster than sed? Anyway, I don't know under which kind of shell my script will run (that's the main problem, because I'm sure there is a way of 'shutting up' zsh), so it's almost impossible to distinguish between valid lines from the command and the shell error message, I can only do assumptions and that's not a good idea... That said, there is no point in using neither grep nor sed :( The whole point of all this mess is my 'mobs' project, a building system. The main program is a (portable) script, but I allow a 'hook' to be run in order to extend the main script capabilities (for example to do autoconf-like checks, etc.). Currently I force the 'hook' to be a shell script and it is run like this: [ -f "0.hook" ] && { # Things sh -c ". ./0.hook" || exit $? # More things } I want to allow the hook to be any kind of binary, no matter if a script-with-a-bangpath or a real binary, but then the problem is the one I explained in my first message: it's impossible to know if the command execution failed or if the command returned with an error (the worst case is when the command returns with 126 or 127, of course). I'm afraid I'm not going to be able to remove the current limitation :((( Any idea is welcome, of course ;) Thanks for your explanation. Raúl Núñez de Arenas Coronado -- Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to...