zsh-workers
 help / color / mirror / code / Atom feed
From: Christophe Martin <schplurtz@free.fr>
To: Bart Schaefer <schaefer@brasslantern.com>,
	Clint Adams <schizo@debian.org>,
	310872@bugs.debian.org
Cc: zsh-workers@sunsite.dk
Subject: Re: Bug#310872: zsh can't be a ksh replacement (can't trap ERR).
Date: Fri, 27 May 2005 14:50:29 +0200	[thread overview]
Message-ID: <42971795.8090005@free.fr> (raw)
In-Reply-To: <1050527012028.ZM21361@candle.brasslantern.com>

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("_/");}}


  reply	other threads:[~2005-05-27 14:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200505261638.SAA09610@sdt.univ-brest.fr>
2005-05-26 19:15 ` Clint Adams
2005-05-27  1:20   ` Bart Schaefer
2005-05-27 12:50     ` Christophe Martin [this message]
2005-05-27 14:19       ` Bart Schaefer
2005-05-27 16:34         ` Christophe Martin
2005-05-27 12:50   ` Christophe Martin
2005-05-30 14:06     ` Clint Adams
2005-05-30 18:41       ` Bart Schaefer
2005-06-01  8:25         ` Oliver Kiddle
2005-06-01 10:31         ` Peter Stephenson
2005-06-01 13:50           ` Bart Schaefer
2005-06-01 13:57           ` Bart Schaefer
2005-06-01 14:04             ` Peter Stephenson
2005-06-01 14:09             ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42971795.8090005@free.fr \
    --to=schplurtz@free.fr \
    --cc=310872@bugs.debian.org \
    --cc=schaefer@brasslantern.com \
    --cc=schizo@debian.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).