Subject: bin/15544: /bin/sh trap command not POSIX compliant
To: None <firstname.lastname@example.org>
From: None <email@example.com>
Date: 02/08/2002 16:19:18
>Synopsis: /bin/sh trap command does not accept signal names
>Arrival-Date: Fri Feb 08 16:20:00 PST 2002
>Originator: Jon Buller
>Release: NetBSD 1.5.3_ALPHA 20020122 (or there abouts)
System: NetBSD bullball.bullers.net 1.5.3_ALPHA NetBSD 1.5.3_ALPHA (BULLBALL) #1: Tue Jan 8 21:51:41 PST 2002 firstname.lastname@example.org:/usr/src/sys/arch/sparc/compile/BULLBALL sparc
cat << EOF > foo
trap "echo trapped" INT
chmod 755 foo
What you get is the message "trap: Illegal number: INT"
I was told this in relation to the problem:
It appears that your shell does not permit symbolic signal
names? They are required by Posix and the only work-around,
using numeric signal names, is only permitted -- not
required by Posix.
Work around by using ksh. I think the fix needs to be made
on line 110 of /usr/src/bin/sh/trap.c (rev 184.108.40.206) by
making is_number() also recognize signal names. Line 115
also needs to be fixed to return the signal number when
number() is given a string with the proper name.