Results for builtin-trap-bash.test.sh

statusbashdashashzshmkshkshtoyshsushbrushosh
pass 221141101116
ok 0000000003
N-I 0330300002
BUG 1000000000
FAIL 019191919222322222
total23232323232323232323
casebashdashashzshmkshkshtoyshsushbrushoshdescription
0pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass pass trap -l
detailsdetailsdetailsdetailsdetailsdetailsdetails
1pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap -p
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
2BUG pass pass pass pass pass FAIL pass FAIL pass trap -p in child is BUGGY in bash
detailsdetailsdetails
3pass FAIL FAIL pass FAIL FAIL FAIL FAIL FAIL pass trap DEBUG ignores $?
detailsdetailsdetailsdetailsdetailsdetailsdetails
4pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass but trap DEBUG respects errexit
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
5pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL ok trap DEBUG with 'return'
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
6pass FAIL FAIL pass FAIL FAIL FAIL FAIL FAIL pass trap DEBUG with 'exit'
detailsdetailsdetailsdetailsdetailsdetailsdetails
7pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap DEBUG with non-compound commands
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
8pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap DEBUG and control flow
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
9pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap DEBUG and command sub / subshell
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
10pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap DEBUG not run in forked interpreter for first pipeline part
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
11pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL ok One 'echo' in first pipeline part - why does bash behave differently from case above?
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
12pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL ok trap DEBUG and pipeline (lastpipe difference)
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
13pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap DEBUG function call
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
14pass FAIL FAIL pass FAIL FAIL FAIL FAIL FAIL pass trap DEBUG case
detailsdetailsdetailsdetailsdetailsdetailsdetails
15pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL N-I trap DEBUG for each
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
16pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL N-I trap DEBUG for expr
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
17pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL pass trap DEBUG if while
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
18pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL trap RETURN
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
19pass FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL Compare trap DEBUG vs. trap ERR
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
20pass N-I N-I FAIL N-I FAIL FAIL FAIL FAIL pass Combine DEBUG trap and USR1 trap
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
21pass N-I N-I FAIL N-I FAIL FAIL FAIL FAIL pass Combine ERR trap and USR1 trap
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
22pass N-I N-I FAIL N-I FAIL FAIL FAIL FAIL pass Combine DEBUG trap and ERR trap
detailsdetailsdetailsdetailsdetailsdetailsdetailsdetails
48 passed, 3 OK, 11 not implemented, 1 BUG, 167 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

dash0 trap -l

[dash status] Expected 0, got 1

stdout:
stderr: 
dash: 1: trap: Illegal option -l
ash0 trap -l

[ash status] Expected 0, got 1

stdout:
stderr: 
ash: trap: line 1: illegal option -l
zsh0 trap -l

[zsh status] Expected 0, got 1

stdout:
stderr: 
mksh0 trap -l

[mksh status] Expected 0, got 1

stdout:
stderr: 
mksh: <stdin>[1]: trap: -l: unknown option
ksh0 trap -l

[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: <stdin>[1]: trap: -l: unknown option
toysh0 trap -l

[toysh status] Expected 0, got 1

stdout:
stderr: 
sh: trap: No such file or directory
sush0 trap -l

[sush status] Expected 0, got 1

stdout:
stderr: 
trap: usage: trap arg signal_spec ...
dash1 trap -p

[dash stdout] Expected 'shown\nexit\n', got 'exit\n'
[dash status] Expected 0, got 2

stdout:
exit
stderr:
dash: 3: trap: Illegal option -p
ash1 trap -p

[ash stdout] Expected 'shown\nexit\n', got 'exit\n'
[ash status] Expected 0, got 2

stdout:
exit
stderr:
ash: trap: line 3: illegal option -p
zsh1 trap -p

[zsh stdout] Expected 'shown\nexit\n', got 'not shown\nexit\n'

stdout:
not shown
exit
stderr:
mksh1 trap -p

[mksh stdout] Expected 'shown\nexit\n', got ''
[mksh status] Expected 0, got 1

stdout:
stderr: 
mksh: <stdin>[3]: trap: -p: unknown option
ksh1 trap -p

[ksh stdout] Expected 'shown\nexit\n', got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
E: ksh: <stdin>[3]: trap: -p: unknown option
toysh1 trap -p

[toysh stdout] Expected 'shown\nexit\n', got 'not shown\n'

stdout:
not shown
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
sush1 trap -p

[sush stdout] Expected 'shown\nexit\n', got 'not shown\nexit\n'

stdout:
not shown
exit
stderr:
trap: usage: trap arg signal_spec ...
brush1 trap -p

[brush stdout] Expected 'shown\nexit\n', got 'shown\n'

stdout:
shown
stderr:
bash2 trap -p in child is BUGGY in bash

stdout:
shown
exit
stderr:
toysh2 trap -p in child is BUGGY in bash

[toysh stdout] Expected 'not shown\nexit\n', got 'not shown\n'

stdout:
not shown
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
brush2 trap -p in child is BUGGY in bash

[brush stdout] Expected 'not shown\nexit\n', got 'shown\n'

stdout:
shown
stderr:
dash3 trap DEBUG ignores $?

[dash stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
trap: DEBUG: bad trap
ash3 trap DEBUG ignores $?

[ash stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
ash: trap: line 6: DEBUG: invalid signal specification
mksh3 trap DEBUG ignores $?

[mksh stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
mksh: <stdin>[6]: trap: bad signal 'DEBUG'
ksh3 trap DEBUG ignores $?

[ksh stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
W: ksh: <stdin>[6]: trap: bad signal: DEBUG
toysh3 trap DEBUG ignores $?

[toysh stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got 'status=127\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=127
A
status=0
B
status=0
stderr:
sh: trap: No such file or directory
sush3 trap DEBUG ignores $?

[sush stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: trap: DEBUG: invalid signal specification
brush3 trap DEBUG ignores $?

[brush stdout] Expected ' [8]\nstatus=0\n [9]\nA\n [10]\nstatus=0\n [11]\nB\n [12]\nstatus=0\n' Got ' [6]\nstatus=0\n [8]\nA\n [10]\nstatus=0\n [12]\nB\n [14]\nstatus=0\n'

stdout:
  [6]
status=0
  [8]
A
  [10]
status=0
  [12]
B
  [14]
status=0
stderr:
dash4 but trap DEBUG respects errexit

[dash stdout] Expected ' [10]\n', got ''
[dash status] Expected 42, got 1

stdout:
stderr: 
trap: DEBUG: bad trap
ash4 but trap DEBUG respects errexit

[ash stdout] Expected ' [10]\n', got ''
[ash status] Expected 42, got 1

stdout:
stderr: 
ash: trap: line 8: DEBUG: invalid signal specification
zsh4 but trap DEBUG respects errexit

[zsh stdout] Expected ' [10]\n', got ' [10]\nstatus=0\n [11]\nA\n [12]\nstatus=0\n [13]\nB\n [14]\nstatus=0\n'
[zsh status] Expected 42, got 0

stdout:
  [10]
status=0
  [11]
A
  [12]
status=0
  [13]
B
  [14]
status=0
stderr:
mksh4 but trap DEBUG respects errexit

[mksh stdout] Expected ' [10]\n', got ''
[mksh status] Expected 42, got 1

stdout:
stderr: 
mksh: <stdin>[8]: trap: bad signal 'DEBUG'
ksh4 but trap DEBUG respects errexit

[ksh stdout] Expected ' [10]\n', got ''
[ksh status] Expected 42, got 1

stdout:
stderr: 
W: ksh: <stdin>[8]: trap: bad signal: DEBUG
toysh4 but trap DEBUG respects errexit

[toysh stdout] Expected ' [10]\n', got 'status=127\nA\nstatus=0\nB\nstatus=0\n'
[toysh status] Expected 42, got 0

stdout:
status=127
A
status=0
B
status=0
stderr:
set: bad -o errexit
sh: trap: No such file or directory
sush4 but trap DEBUG respects errexit

[sush stdout] Expected ' [10]\n', got 'status=1\nA\nstatus=0\nB\nstatus=0\n'
[sush status] Expected 42, got 0

stdout:
status=1
A
status=0
B
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: set: errexit: invalid option name
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 8: trap: DEBUG: invalid signal specification
brush4 but trap DEBUG respects errexit

[brush stdout] Expected ' [10]\n', got ' [8]\nstatus=0\n [10]\nA\n [12]\nstatus=0\n [14]\nB\n [16]\nstatus=0\n'
[brush status] Expected 42, got 0

stdout:
  [8]
status=0
  [10]
A
  [12]
status=0
  [14]
B
  [16]
status=0
stderr:
dash5 trap DEBUG with 'return'

[dash stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
trap: DEBUG: bad trap
ash5 trap DEBUG with 'return'

[ash stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
ash: trap: line 5: DEBUG: invalid signal specification
zsh5 trap DEBUG with 'return'

[zsh stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got ' [7]\n'
[zsh status] Expected 0, got 42

stdout:
  [7]
stderr:
mksh5 trap DEBUG with 'return'

[mksh stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
mksh: <stdin>[5]: trap: bad signal 'DEBUG'
ksh5 trap DEBUG with 'return'

[ksh stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
W: ksh: <stdin>[5]: trap: bad signal: DEBUG
toysh5 trap DEBUG with 'return'

[toysh stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got 'status=127\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=127
A
status=0
B
status=0
stderr:
sh: trap: No such file or directory
sush5 trap DEBUG with 'return'

[sush stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got 'status=1\nA\nstatus=0\nB\nstatus=0\n'

stdout:
status=1
A
status=0
B
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: trap: DEBUG: invalid signal specification
brush5 trap DEBUG with 'return'

[brush stdout] Expected ' [7]\nstatus=0\n [8]\nA\n [9]\nstatus=0\n [10]\nB\n [11]\nstatus=0\n' Got ' [6]\nstatus=0\n [8]\nA\n [10]\nstatus=0\n [12]\nB\n [14]\nstatus=0\n'

stdout:
  [6]
status=0
  [8]
A
  [10]
status=0
  [12]
B
  [14]
status=0
stderr:
return: can only be used in a function or sourced script
return: can only be used in a function or sourced script
return: can only be used in a function or sourced script
return: can only be used in a function or sourced script
return: can only be used in a function or sourced script
osh5 trap DEBUG with 'return'

stdout:
  [7]
stderr:
dash6 trap DEBUG with 'exit'

[dash stdout] Expected ' [7]\n', got 'status=1\nA\nstatus=0\nB\nstatus=0\n'
[dash status] Expected 42, got 0

stdout:
status=1
A
status=0
B
status=0
stderr:
trap: DEBUG: bad trap
ash6 trap DEBUG with 'exit'

[ash stdout] Expected ' [7]\n', got 'status=1\nA\nstatus=0\nB\nstatus=0\n'
[ash status] Expected 42, got 0

stdout:
status=1
A
status=0
B
status=0
stderr:
ash: trap: line 5: DEBUG: invalid signal specification
mksh6 trap DEBUG with 'exit'

[mksh stdout] Expected ' [7]\n', got 'status=1\nA\nstatus=0\nB\nstatus=0\n'
[mksh status] Expected 42, got 0

stdout:
status=1
A
status=0
B
status=0
stderr:
mksh: <stdin>[5]: trap: bad signal 'DEBUG'
ksh6 trap DEBUG with 'exit'

[ksh stdout] Expected ' [7]\n', got 'status=1\nA\nstatus=0\nB\nstatus=0\n'
[ksh status] Expected 42, got 0

stdout:
status=1
A
status=0
B
status=0
stderr:
W: ksh: <stdin>[5]: trap: bad signal: DEBUG
toysh6 trap DEBUG with 'exit'

[toysh stdout] Expected ' [7]\n', got 'status=127\nA\nstatus=0\nB\nstatus=0\n'
[toysh status] Expected 42, got 0

stdout:
status=127
A
status=0
B
status=0
stderr:
sh: trap: No such file or directory
sush6 trap DEBUG with 'exit'

[sush stdout] Expected ' [7]\n', got 'status=1\nA\nstatus=0\nB\nstatus=0\n'
[sush status] Expected 42, got 0

stdout:
status=1
A
status=0
B
status=0
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 5: trap: DEBUG: invalid signal specification
brush6 trap DEBUG with 'exit'

[brush stdout] Expected ' [7]\n', got ' [6]\nstatus=0\n [8]\nA\n [10]\nstatus=0\n [12]\nB\n [14]\nstatus=0\n'
[brush status] Expected 42, got 0

stdout:
  [6]
status=0
  [8]
A
  [10]
status=0
  [12]
B
  [14]
status=0
stderr:
dash7 trap DEBUG with non-compound commands

[dash stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got ''

stdout:
stderr: 
ash7 trap DEBUG with non-compound commands

[ash stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got 'a\nb\nc\nd\ne\nf\n'

stdout:
a
b
c
d
e
f
stderr:
ash: trap: line 6: DEBUG: invalid signal specification
ash: h: not found
zsh7 trap DEBUG with non-compound commands

[zsh stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n'

stdout:
  [8]
a
  [9]
b
  [9]
c
  [11]
d
e
  [12]
f
  [14]
  [15]
  [17]
  [19]
stderr:
mksh7 trap DEBUG with non-compound commands

[mksh stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got ''

stdout:
stderr: 
ksh7 trap DEBUG with non-compound commands

[ksh stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got 'a\nb\nc\nd\ne\nf\n'

stdout:
a
b
c
d
e
f
stderr:
W: ksh: <stdin>[6]: trap: bad signal: DEBUG
toysh7 trap DEBUG with non-compound commands

[toysh stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush7 trap DEBUG with non-compound commands

[sush stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got 'a\nb\nc\nd\ne\nf\n'

stdout:
a
b
c
d
e
f
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: trap: DEBUG: invalid signal specification
brush7 trap DEBUG with non-compound commands

[brush stdout] Expected ' [8]\na\n [9]\nb\n [9]\nc\n [11]\nd\n [11]\ne\n [12]\nf\n [14]\n [15]\n [17]\n [19]\n' Got ' [7]\na\n [9]\nb\n [10]\nc\n [13]\nd\n [14]\ne\n [16]\nf\n [24]\n'

stdout:
  [7]
a
  [9]
b
  [10]
c
  [13]
d
  [14]
e
  [16]
f
  [24]
stderr:
dash8 trap DEBUG and control flow

[dash stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got 'hello\n'

stdout:
hello
stderr:
trap: DEBUG: bad trap
ash8 trap DEBUG and control flow

[ash stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got 'hello\n'

stdout:
hello
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh8 trap DEBUG and control flow

[zsh stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got ' [6]\n [6]\n [7]\nhello\n [8]\n'

stdout:
  [6]
  [6]
  [7]
hello
  [8]
stderr:
mksh8 trap DEBUG and control flow

[mksh stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got 'hello\n'

stdout:
hello
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh8 trap DEBUG and control flow

[ksh stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got 'hello\n'

stdout:
hello
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh8 trap DEBUG and control flow

[toysh stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got 'hello\n'

stdout:
hello
stderr:
sh: trap: No such file or directory
sush8 trap DEBUG and control flow

[sush stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got 'hello\n'

stdout:
hello
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush8 trap DEBUG and control flow

[brush stdout] Expected ' [6]\n [7]\nhello\n [8]\n', got ' [5]\n [6]\nhello\n [7]\n'

stdout:
  [5]
  [6]
hello
  [7]
stderr:
dash9 trap DEBUG and command sub / subshell

[dash stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got ''

stdout:
stderr: 
ash9 trap DEBUG and command sub / subshell

[ash stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got 'result = command sub\ntwo\nsubshell\ntwo\ndone\n'

stdout:
result = command sub
two
subshell
two
done
stderr:
ash: trap: line 6: DEBUG: invalid signal specification
zsh9 trap DEBUG and command sub / subshell

[zsh stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got ' [8]\nresult = [8]\ncommand sub\n [8]\ntwo\n [9]\n [9]\nsubshell\n [10]\ntwo\n [12]\ndone\n'

stdout:
  [8]
result =   [8]
command sub
  [8]
two
  [9]
  [9]
subshell
  [10]
two
  [12]
done
stderr:
mksh9 trap DEBUG and command sub / subshell

[mksh stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got ''

stdout:
stderr: 
ksh9 trap DEBUG and command sub / subshell

[ksh stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got 'result = command sub\ntwo\nsubshell\ntwo\ndone\n'

stdout:
result = command sub
two
subshell
two
done
stderr:
W: ksh: <stdin>[6]: trap: bad signal: DEBUG
toysh9 trap DEBUG and command sub / subshell

[toysh stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
main: line 1: sh: syntax error: (
sush9 trap DEBUG and command sub / subshell

[sush stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got 'result = command sub\ntwo\nsubshell\ntwo\ndone\n'

stdout:
result = command sub
two
subshell
two
done
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 6: trap: DEBUG: invalid signal specification
brush9 trap DEBUG and command sub / subshell

[brush stdout] Expected ' [8]\nresult = command sub\ntwo\nsubshell\ntwo\n [12]\ndone\n' Got ' [7]\nresult = [8]\ncommand sub\n [9]\ntwo\n [9]\nsubshell\n [10]\ntwo\n [10]\ndone\n'

stdout:
  [7]
result =   [8]
command sub
  [9]
two
  [9]
subshell
  [10]
two
  [10]
done
stderr:
dash10 trap DEBUG not run in forked interpreter for first pipeline part

[dash stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got 'pipe1\npipe2\nok\n'

stdout:
pipe1
pipe2
ok
stderr:
trap: DEBUG: bad trap
ash10 trap DEBUG not run in forked interpreter for first pipeline part

[ash stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got 'pipe1\npipe2\nok\n'

stdout:
pipe1
pipe2
ok
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh10 trap DEBUG not run in forked interpreter for first pipeline part

[zsh stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got ' LINENO=6\n LINENO=6\npipe1\n LINENO=7\npipe2\n LINENO=9\nok\n'

stdout:
  LINENO=6
  LINENO=6
pipe1
  LINENO=7
pipe2
  LINENO=9
ok
stderr:
mksh10 trap DEBUG not run in forked interpreter for first pipeline part

[mksh stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got 'pipe1\npipe2\nok\n'

stdout:
pipe1
pipe2
ok
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh10 trap DEBUG not run in forked interpreter for first pipeline part

[ksh stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got 'pipe1\npipe2\nok\n'

stdout:
pipe1
pipe2
ok
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh10 trap DEBUG not run in forked interpreter for first pipeline part

[toysh stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got 'pipe1\npipe2\nok\n'

stdout:
pipe1
pipe2
ok
stderr:
sh: trap: No such file or directory
sush10 trap DEBUG not run in forked interpreter for first pipeline part

[sush stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got 'pipe1\npipe2\nok\n'

stdout:
pipe1
pipe2
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush10 trap DEBUG not run in forked interpreter for first pipeline part

[brush stdout] Expected ' LINENO=8\npipe1\npipe2\n LINENO=9\nok\n', got ' LINENO=5\npipe1\n LINENO=6\npipe2\n LINENO=9\nok\n'

stdout:
  LINENO=5
pipe1
  LINENO=6
pipe2
  LINENO=9
ok
stderr:
ERROR main: syntax error near token `|' (line 1 col 3)
dash11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[dash stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got 'pipeline\nok\n'

stdout:
pipeline
ok
stderr:
trap: DEBUG: bad trap
ash11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[ash stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got 'pipeline\nok\n'

stdout:
pipeline
ok
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[zsh stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got ' LINENO=6\npipeline\n LINENO=8\nok\n'

stdout:
  LINENO=6
pipeline
  LINENO=8
ok
stderr:
mksh11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[mksh stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got 'pipeline\nok\n'

stdout:
pipeline
ok
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[ksh stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got 'pipeline\nok\n'

stdout:
pipeline
ok
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[toysh stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got 'pipeline\nok\n'

stdout:
pipeline
ok
stderr:
sh: trap: No such file or directory
sush11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[sush stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got 'pipeline\nok\n'

stdout:
pipeline
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush11 One 'echo' in first pipeline part - why does bash behave differently from case above?

[brush stdout] Expected ' LINENO=6\n LINENO=7\npipeline\n LINENO=8\nok\n' Got ' LINENO=5\npipeline\n LINENO=8\nok\n'

stdout:
  LINENO=5
pipeline
  LINENO=8
ok
stderr:
ERROR main: syntax error near token `|' (line 1 col 3)
osh11 One 'echo' in first pipeline part - why does bash behave differently from case above?

stdout:
  LINENO=7
pipeline
  LINENO=8
ok
stderr:
dash12 trap DEBUG and pipeline (lastpipe difference)

[dash stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
trap: DEBUG: bad trap
ash12 trap DEBUG and pipeline (lastpipe difference)

[ash stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh12 trap DEBUG and pipeline (lastpipe difference)

[zsh stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got ' [6]\n [6]\na\n [6]\nb\n [8]\n4\n [10]\n1\n [12]\n1\n'

stdout:
  [6]
  [6]
a
  [6]
b
  [8]
4
  [10]
1
  [12]
1
stderr:
mksh12 trap DEBUG and pipeline (lastpipe difference)

[mksh stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh12 trap DEBUG and pipeline (lastpipe difference)

[ksh stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh12 trap DEBUG and pipeline (lastpipe difference)

[toysh stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
sh: trap: No such file or directory
sush12 trap DEBUG and pipeline (lastpipe difference)

[sush stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got 'a\nb\n2\n1\n1\n'

stdout:
a
b
2
1
1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush12 trap DEBUG and pipeline (lastpipe difference)

[brush stdout] Expected ' [6]\na\n [6]\nb\n [8]\n2\n [10]\n [10]\n [10]\n1\n [12]\n [13]\n [14]\n1\n' Got ' [5]\na\n [6]\nb\n [9]\n4\n [11]\n3\n [13]\n3\n'

stdout:
  [5]
a
  [6]
b
  [9]
4
  [11]
3
  [13]
3
stderr:
osh12 trap DEBUG and pipeline (lastpipe difference)

stdout:
  [6]
a
  [6]
b
  [8]
2
  [10]
1
  [14]
1
stderr:
dash13 trap DEBUG function call

[dash stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got 'i=A\ni=B\nnext\ni=X\ni=Y\nok\n'

stdout:
i=A
i=B
next
i=X
i=Y
ok
stderr:
trap: DEBUG: bad trap
ash13 trap DEBUG function call

[ash stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got 'i=A\ni=B\nnext\ni=X\ni=Y\nok\n'

stdout:
i=A
i=B
next
i=X
i=Y
ok
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh13 trap DEBUG function call

[zsh stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got ' [6]\n [13]\n [1]\n [2]\n [3]\ni=A\n [3]\ni=B\n [15]\nnext\n [17]\n [1]\n [2]\n [3]\ni=X\n [3]\ni=Y\n [19]\nok\n'

stdout:
  [6]
  [13]
  [1]
  [2]
  [3]
i=A
  [3]
i=B
  [15]
next
  [17]
  [1]
  [2]
  [3]
i=X
  [3]
i=Y
  [19]
ok
stderr:
mksh13 trap DEBUG function call

[mksh stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got 'i=A\ni=B\nnext\ni=X\ni=Y\nok\n'

stdout:
i=A
i=B
next
i=X
i=Y
ok
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh13 trap DEBUG function call

[ksh stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got 'i=A\ni=B\nnext\ni=X\ni=Y\nok\n'

stdout:
i=A
i=B
next
i=X
i=Y
ok
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh13 trap DEBUG function call

[toysh stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got 'i=A\ni=B\nnext\ni=X\ni=Y\nok\n'

stdout:
i=A
i=B
next
i=X
i=Y
ok
stderr:
sh: trap: No such file or directory
sush13 trap DEBUG function call

[sush stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got 'i=A\ni=B\nnext\ni=X\ni=Y\nok\n'

stdout:
i=A
i=B
next
i=X
i=Y
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush13 trap DEBUG function call

[brush stdout] Expected ' [13]\ni=A\ni=B\n [15]\nnext\n [17]\ni=X\ni=Y\n [19]\nok\n' Got ' [7]\n [8]\n [9]\ni=A\n [10]\ni=B\n [13]\nnext\n [16]\n [17]\n [18]\ni=X\n [19]\ni=Y\n [22]\nok\n'

stdout:
  [7]
  [8]
  [9]
i=A
  [10]
i=B
  [13]
next
  [16]
  [17]
  [18]
i=X
  [19]
i=Y
  [22]
ok
stderr:
dash14 trap DEBUG case

[dash stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got 'python\nok\n'

stdout:
python
ok
stderr:
trap: DEBUG: bad trap
ash14 trap DEBUG case

[ash stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got 'python\nok\n'

stdout:
python
ok
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
mksh14 trap DEBUG case

[mksh stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got 'python\nok\n'

stdout:
python
ok
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh14 trap DEBUG case

[ksh stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got 'python\nok\n'

stdout:
python
ok
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh14 trap DEBUG case

[toysh stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got 'python\n'
[toysh status] Expected 0, got -6

stdout:
python
stderr:
sh: trap: No such file or directory
free(): invalid pointer
sush14 trap DEBUG case

[sush stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got 'python\nok\n'

stdout:
python
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush14 trap DEBUG case

[brush stdout] Expected ' [6]\n [8]\n [10]\npython\n [16]\nok\n', got ' [7]\npython\n [9]\nok\n'

stdout:
  [7]
python
  [9]
ok
stderr:
dash15 trap DEBUG for each

[dash stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got 'x=1\nx=2\nok\n'

stdout:
x=1
x=2
ok
stderr:
trap: DEBUG: bad trap
ash15 trap DEBUG for each

[ash stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got 'x=1\nx=2\nok\n'

stdout:
x=1
x=2
ok
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh15 trap DEBUG for each

[zsh stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got ' [6]\n [7]\nx=1\n [7]\nx=2\n [10]\nok\n'

stdout:
  [6]
  [7]
x=1
  [7]
x=2
  [10]
ok
stderr:
mksh15 trap DEBUG for each

[mksh stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got 'x=1\nx=2\nok\n'

stdout:
x=1
x=2
ok
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh15 trap DEBUG for each

[ksh stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got 'x=1\nx=2\nok\n'

stdout:
x=1
x=2
ok
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh15 trap DEBUG for each

[toysh stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got 'x=1\nx=2\nok\n'

stdout:
x=1
x=2
ok
stderr:
sh: trap: No such file or directory
sush15 trap DEBUG for each

[sush stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got 'x=1\nx=2\nok\n'

stdout:
x=1
x=2
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush15 trap DEBUG for each

[brush stdout] Expected ' [6]\n [7]\nx=1\n [6]\n [7]\nx=2\n [10]\nok\n' Got ' [5]\nx=1\n [6]\nx=2\n [9]\nok\n'

stdout:
  [5]
x=1
  [6]
x=2
  [9]
ok
stderr:
osh15 trap DEBUG for each

stdout:
  [7]
x=1
  [7]
x=2
  [10]
ok
stderr:
dash16 trap DEBUG for expr

[dash stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ''
[dash status] Expected 0, got 2

stdout:
stderr: 
trap: DEBUG: bad trap
dash: 6: Syntax error: Bad for loop variable
ash16 trap DEBUG for expr

[ash stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ''
[ash status] Expected 0, got 2

stdout:
stderr: 
ash: trap: line 4: DEBUG: invalid signal specification
ash: syntax error: bad for loop variable
zsh16 trap DEBUG for expr

[zsh stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ' [6]\n [7]\ni=3\n [7]\ni=4\n [10]\nok\n'

stdout:
  [6]
  [7]
i=3
  [7]
i=4
  [10]
ok
stderr:
mksh16 trap DEBUG for expr

[mksh stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ''
[mksh status] Expected 0, got 1

stdout:
stderr: 
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
mksh: <stdin>[6]: syntax error: '((' unexpected
ksh16 trap DEBUG for expr

[ksh stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ''
[ksh status] Expected 0, got 1

stdout:
stderr: 
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
E: ksh: <stdin>[6]: syntax error: unexpected '(('
toysh16 trap DEBUG for expr

[toysh stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ''
[toysh status] Expected 0, got 2

stdout:
stderr: 
sh: trap: No such file or directory
main: line 6: sh: syntax error: ;
sush16 trap DEBUG for expr

[sush stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got 'i=3\ni=4\nok\n'

stdout:
i=3
i=4
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush16 trap DEBUG for expr

[brush stdout] Expected ' [6]\n [6]\n [7]\ni=3\n [6]\n [6]\n [7]\ni=4\n [6]\n [6]\n [10]\nok\n' Got ' [5]\ni=3\n [6]\ni=4\n [9]\nok\n'

stdout:
  [5]
i=3
  [6]
i=4
  [9]
ok
stderr:
osh16 trap DEBUG for expr

stdout:
  [7]
i=3
  [7]
i=4
  [10]
ok
stderr:
dash17 trap DEBUG if while

[dash stdout] Expected ' [6]\n [7]\nif\n [10]\n', got 'if\n'

stdout:
if
stderr:
trap: DEBUG: bad trap
ash17 trap DEBUG if while

[ash stdout] Expected ' [6]\n [7]\nif\n [10]\n', got 'if\n'

stdout:
if
stderr:
ash: trap: line 4: DEBUG: invalid signal specification
zsh17 trap DEBUG if while

[zsh stdout] Expected ' [6]\n [7]\nif\n [10]\n', got ' [6]\n [6]\n [7]\nif\n [10]\n [10]\n'

stdout:
  [6]
  [6]
  [7]
if
  [10]
  [10]
stderr:
mksh17 trap DEBUG if while

[mksh stdout] Expected ' [6]\n [7]\nif\n [10]\n', got 'if\n'

stdout:
if
stderr:
mksh: <stdin>[4]: trap: bad signal 'DEBUG'
ksh17 trap DEBUG if while

[ksh stdout] Expected ' [6]\n [7]\nif\n [10]\n', got 'if\n'

stdout:
if
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh17 trap DEBUG if while

[toysh stdout] Expected ' [6]\n [7]\nif\n [10]\n', got 'if\n'

stdout:
if
stderr:
sh: trap: No such file or directory
sush17 trap DEBUG if while

[sush stdout] Expected ' [6]\n [7]\nif\n [10]\n', got 'if\n'

stdout:
if
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush17 trap DEBUG if while

[brush stdout] Expected ' [6]\n [7]\nif\n [10]\n', got ' [5]\n [6]\nif\n [9]\n'

stdout:
  [5]
  [6]
if
  [9]
stderr:
dash18 trap RETURN

[dash stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
trap: RETURN: bad trap
ash18 trap RETURN

[ash stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
ash: trap: line 16: RETURN: invalid signal specification
zsh18 trap RETURN

[zsh stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
trap: undefined signal: RETURN
mksh18 trap RETURN

[mksh stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
mksh: <stdin>[16]: trap: bad signal 'RETURN'
ksh18 trap RETURN

[ksh stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
W: ksh: <stdin>[16]: trap: bad signal: RETURN
toysh18 trap RETURN

[toysh stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '\nf\n\n\ng\n\nreturn-helper.sh\nshould not see\n'
[toysh status] Expected 42, got 0

stdout:
f


g

return-helper.sh
should not see
stderr:
sh: trap: No such file or directory
sush18 trap RETURN

[sush stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 16: trap: RETURN: invalid signal specification
brush18 trap RETURN

[brush stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
osh18 trap RETURN

[osh stdout] Expected '--\nf\n--\n--\ng\n--\nreturn-helper.sh\nprofile [x y]\n' Got '--\nf\n--\n--\ng\n--\nreturn-helper.sh\n'

stdout:
--
f
--
--
g
--
return-helper.sh
stderr:
osh warning: The 'RETURN' hook isn't implemented
dash19 Compare trap DEBUG vs. trap ERR

[dash stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'ok\n'

stdout:
ok
stderr:
trap: DEBUG: bad trap
trap: DEBUG: bad trap
trap: ERR: bad trap
ash19 Compare trap DEBUG vs. trap ERR

[ash stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'err 12\nerr 16\nok\n'

stdout:
err 12
err 16
ok
stderr:
ash: trap: line 1: DEBUG: invalid signal specification
ash: trap: line 9: DEBUG: invalid signal specification
zsh19 Compare trap DEBUG vs. trap ERR

[zsh stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'dbg 3\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nerr 18\nok\n'

stdout:
dbg 3
dbg 5
dbg 7
dbg 9
err 14
err 16
err 18
ok
stderr:
mksh19 Compare trap DEBUG vs. trap ERR

[mksh stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'err 12\nerr 16\nok\n'

stdout:
err 12
err 16
ok
stderr:
mksh: <stdin>[1]: trap: bad signal 'DEBUG'
mksh: <stdin>[9]: trap: bad signal 'DEBUG'
ksh19 Compare trap DEBUG vs. trap ERR

[ksh stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'err 12\nerr 16\nok\n'

stdout:
err 12
err 16
ok
stderr:
W: ksh: <stdin>[1]: trap: bad signal: DEBUG
W: ksh: <stdin>[9]: trap: bad signal: DEBUG
toysh19 Compare trap DEBUG vs. trap ERR

[toysh stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'ok\n'

stdout:
ok
stderr:
sh: trap: No such file or directory
sh: trap: No such file or directory
sh: trap: No such file or directory
sush19 Compare trap DEBUG vs. trap ERR

[sush stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'ok\n'

stdout:
ok
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 1: trap: DEBUG: invalid signal specification
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 9: trap: DEBUG: invalid signal specification
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 12: trap: ERR: invalid signal specification
brush19 Compare trap DEBUG vs. trap ERR

[brush stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'dbg 4\ndbg 6\ndbg 7\ndbg 8\ndbg 11\ndbg 14\nok\n'

stdout:
dbg 4
dbg 6
dbg 7
dbg 8
dbg 11
dbg 14
ok
stderr:
osh19 Compare trap DEBUG vs. trap ERR

[osh stdout] Expected 'dbg 3\ndbg 3\ndbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n' Got 'dbg 3\ndbg 5\ndbg 5\ndbg 5\ndbg 7\ndbg 9\nerr 14\nerr 16\nok\n'

stdout:
dbg 3
dbg 5
dbg 5
dbg 5
dbg 7
dbg 9
err 14
err 16
ok
stderr:
dash20 Combine DEBUG trap and USR1 trap

stdout:
stderr: 
ash20 Combine DEBUG trap and USR1 trap

stdout:
stderr: 
zsh20 Combine DEBUG trap and USR1 trap

[zsh stdout] Expected '6 dbg\n1 dbg\n1 dbg\n1 usr1\n7 dbg\nafter=0\n', got '6 dbg\n6 usr1\n7 dbg\nafter=0\n'

stdout:
6 dbg
6 usr1
7 dbg
after=0
stderr:
mksh20 Combine DEBUG trap and USR1 trap

stdout:
stderr: 
ksh20 Combine DEBUG trap and USR1 trap

[ksh stdout] Expected '6 dbg\n1 dbg\n1 dbg\n1 usr1\n7 dbg\nafter=0\n', got '6 usr1\nafter=0\n'

stdout:
6 usr1
after=0
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh20 Combine DEBUG trap and USR1 trap

[toysh stdout] Expected '6 dbg\n1 dbg\n1 dbg\n1 usr1\n7 dbg\nafter=0\n', got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush20 Combine DEBUG trap and USR1 trap

[sush stdout] Expected '6 dbg\n1 dbg\n1 dbg\n1 usr1\n7 dbg\nafter=0\n', got 'after=0\n1 usr1\n'

stdout:
after=0
1 usr1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush20 Combine DEBUG trap and USR1 trap

[brush stdout] Expected '6 dbg\n1 dbg\n1 dbg\n1 usr1\n7 dbg\nafter=0\n', got '7 dbg\n'
[brush status] Expected 0, got -10

stdout:
7 dbg
stderr:
dash21 Combine ERR trap and USR1 trap

stdout:
stderr: 
ash21 Combine ERR trap and USR1 trap

stdout:
stderr: 
zsh21 Combine ERR trap and USR1 trap

[zsh stdout] Expected '1 err\n1 usr1\nafter=0\n', got '6 usr1\nafter=0\n'

stdout:
6 usr1
after=0
stderr:
mksh21 Combine ERR trap and USR1 trap

stdout:
stderr: 
ksh21 Combine ERR trap and USR1 trap

[ksh stdout] Expected '1 err\n1 usr1\nafter=0\n', got '6 err\n6 usr1\nafter=0\n'

stdout:
6 err
6 usr1
after=0
stderr:
toysh21 Combine ERR trap and USR1 trap

[toysh stdout] Expected '1 err\n1 usr1\nafter=0\n', got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush21 Combine ERR trap and USR1 trap

[sush stdout] Expected '1 err\n1 usr1\nafter=0\n', got 'after=0\n1 usr1\n'

stdout:
after=0
1 usr1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: ERR: invalid signal specification
brush21 Combine ERR trap and USR1 trap

[brush stdout] Expected '1 err\n1 usr1\nafter=0\n', got ''
[brush status] Expected 0, got -10

stdout:
stderr: 
dash22 Combine DEBUG trap and ERR trap

stdout:
stderr: 
ash22 Combine DEBUG trap and ERR trap

stdout:
stderr: 
zsh22 Combine DEBUG trap and ERR trap

[zsh stdout] Expected '6 err\n6 debug\n6 debug\n6 debug\n6 err\n7 err\n7 debug\nafter=1\n' Got '6 debug\n6 err\n7 debug\nafter=1\n'

stdout:
6 debug
6 err
7 debug
after=1
stderr:
mksh22 Combine DEBUG trap and ERR trap

stdout:
stderr: 
ksh22 Combine DEBUG trap and ERR trap

[ksh stdout] Expected '6 err\n6 debug\n6 debug\n6 debug\n6 err\n7 err\n7 debug\nafter=1\n' Got '4 err\n6 err\nafter=1\n'

stdout:
4 err
6 err
after=1
stderr:
W: ksh: <stdin>[4]: trap: bad signal: DEBUG
toysh22 Combine DEBUG trap and ERR trap

[toysh stdout] Expected '6 err\n6 debug\n6 debug\n6 debug\n6 err\n7 err\n7 debug\nafter=1\n' Got ''
[toysh status] Expected 0, got -6

stdout:
stderr: 
munmap_chunk(): invalid pointer
sush22 Combine DEBUG trap and ERR trap

[sush stdout] Expected '6 err\n6 debug\n6 debug\n6 debug\n6 err\n7 err\n7 debug\nafter=1\n' Got 'after=1\n'

stdout:
after=1
stderr:
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 3: trap: ERR: invalid signal specification
/home/andy/git/oils-for-unix/oils/../../shells/rusty_bash/target/release/sush: line 4: trap: DEBUG: invalid signal specification
brush22 Combine DEBUG trap and ERR trap

[brush stdout] Expected '6 err\n6 debug\n6 debug\n6 debug\n6 err\n7 err\n7 debug\nafter=1\n' Got '7 debug\n9 debug\nafter=1\n'

stdout:
7 debug
9 debug
after=1
stderr: