-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
bugSomething is not workingSomething is not working
Description
Tested with ksh Version AJMv 93u+m/1.0.0-alpha+ccd98fe7 2021-01-08 on Ubuntu 20.04
1. Redirecting disables the DEBUG trap
edit: fixed in 2a835a2, e664b78
trap 'echo LINENO: $LINENO >&1' DEBUG # 1
echo foo # 2
var=$(echo) # 3
echo bar # 4
echo baz # 5Expected (This is what happens when you remove >&1).
LINENO: 2
foo
LINENO: 3
LINENO: 4
bar
LINENO: 5
baz
Actual
LINENO: 2
foo
bar
baz
2. Crashes when re-trapping inside a subshell
edit: fixed in 2a835a2
set -e
trap ':' DEBUG
( trap ':' DEBUG )
echo okksh.sh[22]: ^P?`?^X?%?d�: not found [No such file or directory]
3. The split word will not work
edit: fixed in 70368c5
v=''
trap ': $v' DEBUG
A="a b c"
set -- $A
printf '%s\n' "$@"Expected
a
b
c
Actual
a b c
4. Side effects to exit status
edit: fixed in d00b4b3
trap ':' DEBUG
(exit 123)
echo $? # => 123 (Correct)
r=$(exit 123)
echo $? # => Same as above, expected 123, but actually 0.Metadata
Metadata
Assignees
Labels
bugSomething is not workingSomething is not working