On Tue, Aug 19, 2014 at 10:54 AM, gerald cato <[email protected]>
wrote:

>  Hi,
>
> I've noticed inconsistent behavior between trap <number> vs trap <name>
> when action is null.  For example:
>
> $ Version jM 93u 2011-02-08
>
> $ trap '' 0
> $ trap 0
> $ trap '' exit
> $ trap exit
> ksh: trap: condition(s) required
>
> $ trap '' 1
> $ trap 1
> $ trap '' HUP
> $ trap HUP
> ksh: trap: condition(s) required
> $
>

According to the ksh(1) manual (Version jM 93u 2011-02-08), "If *action* is
omitted and the first *sig* is a number, or if *action* is -, then the
trap(s) for each *sig* are reset to their original values". So both `trap
exit' and `trap HUP' are invalid commands as "exit" and "HUP" are not
numbers.

-clark

>
> $ Version M-11/16/88i
> $ trap '' exit
> $ trap '' 0
> $ trap exit
> $ trap 0
>
> Not sure if this has been fixed in a later release.
>
> Cheers, Gerald
>
>
> _______________________________________________
> ast-developers mailing list
> [email protected]
> http://lists.research.att.com/mailman/listinfo/ast-developers
>
>
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to