From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5215 invoked from network); 27 May 2005 14:12:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 May 2005 14:12:43 -0000 Received: (qmail 23315 invoked from network); 27 May 2005 14:12:38 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 May 2005 14:12:38 -0000 Received: (qmail 4675 invoked by alias); 27 May 2005 14:12:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21286 Received: (qmail 25802 invoked from network); 27 May 2005 12:50:51 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 May 2005 12:50:51 -0000 Received: (qmail 69697 invoked from network); 27 May 2005 12:50:51 -0000 Received: from sdt.univ-brest.fr (194.167.226.209) by a.mx.sunsite.dk with SMTP; 27 May 2005 12:50:47 -0000 Received: from [194.167.226.194] (dormeur.univ-brest.fr [194.167.226.194]) by sdt.univ-brest.fr (8.9.3/jtpda-5.3.1) with ESMTP id OAA27474 ; Fri, 27 May 2005 14:50:29 +0200 (MEST) Message-ID: <42971795.8090005@free.fr> Date: Fri, 27 May 2005 14:50:29 +0200 From: Christophe Martin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050331) X-Accept-Language: fr, en MIME-Version: 1.0 To: Bart Schaefer , Clint Adams , 310872@bugs.debian.org CC: zsh-workers@sunsite.dk Subject: Re: Bug#310872: zsh can't be a ksh replacement (can't trap ERR). References: <200505261638.SAA09610@sdt.univ-brest.fr> <20050526191520.GA30061@scowler.net> <1050527012028.ZM21361@candle.brasslantern.com> In-Reply-To: <1050527012028.ZM21361@candle.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi, Bart Schaefer a écrit : > > Zsh does not provide an ERR trap because some platforms on which zsh can be > compiled actually have SIGERR defined, which is a real OS-level signal and > not interchangeable with the ksh et al. use of ERR as a magic trap. > > The zsh equivalent is > > trap 'echo alert-an-error-occured' ZERR Don't you think it's strange to trap a Zsomething in Ksh ?? > > A possible workaround would be > > (( $signals[(I)ERR] )) || alias -g ERR=ZERR > Waow ! That's knowing zsh ! But, If i keep zsh as ksh I have to rewrite every script to put this workaround in. On the other hand, if I ever run the modified script with the more traditionnal ksh, the workaround fails. So, for this particular problem of trap ERR, there are only problems in using zsh as a ksh, at least on platform where ksh ERR does not conflict with OS SIGERR. (By the way, what are the platform with OS SIGERR ? And do some ksh run on them ?) Regards, Christophe -- char*p="c+)1+)I1+++(Y1)I1)1)I1)19Y(QII1)1)I1)19Q(K)K+)I1+9I(a)I1)II1))AA(91)I\ 1)II1)199(3+)1)K+)19;(";main(_){while(*p){for(_=*p-32>>3;_;--_)putchar(' '); if (!(_=*p++-32&7))putchar('\n');else while(_--)printf("_/");}}