From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6688 invoked from network); 29 Mar 2005 23:17:39 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Mar 2005 23:17:39 -0000 Received: (qmail 45365 invoked from network); 29 Mar 2005 23:17:33 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Mar 2005 23:17:33 -0000 Received: (qmail 3215 invoked by alias); 29 Mar 2005 23:17:29 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21071 Received: (qmail 3198 invoked from network); 29 Mar 2005 23:17:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 29 Mar 2005 23:17:28 -0000 Received: (qmail 45013 invoked from network); 29 Mar 2005 23:17:28 -0000 Received: from dan.emsphone.com (199.67.51.101) by a.mx.sunsite.dk with SMTP; 29 Mar 2005 23:17:22 -0000 Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j2TNHJ3H046284 for zsh-workers@sunsite.dk; Tue, 29 Mar 2005 17:17:19 -0600 (CST) (envelope-from dan) Date: Tue, 29 Mar 2005 17:17:19 -0600 From: Dan Nelson To: zsh-workers@sunsite.dk Subject: Parse errors don't cause a non-zero exit code? Message-ID: <20050329231719.GH51674@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-OS: FreeBSD 5.4-PRERELEASE X-message-flag: Outlook Error User-Agent: Mutt/1.5.8i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 $ echo "'" > /tmp/test ; zsh -f /tmp/test ; echo $? /tmp/test:2: unmatched ' 0 ksh93, ash, and bash all return non-zero here, and it looks like http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_08 wants a non-zero result also. A co-worker asked about it because he wanted to use "zsh -n" to test user-submitted scripts for silly typos before running them. Checking for output on stderr is a workaround. A related comment: The zsh documentation uses all six combinations of "{exit,return} {code,value,status}", making it hard to search :( -- Dan Nelson dnelson@allantgroup.com