]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/dbg-support2.tests
Bash-4.3 patch 22
[thirdparty/bash.git] / tests / dbg-support2.tests
CommitLineData
b80f6443
JA
1#!../bash
2#
3# Test correct trap return codes = 2 means skip execution.
4shopt -s extdebug
5print_trap() {
6 echo "lineno: $1 ($LINENO) ${FUNCNAME[1]}"
7 if [[ $debug_exit == 2 ]] ; then
8 debug_exit=0
9 return 2
10 fi
11 return 0
12}
13
14debug_exit=0
15trap 'print_trap $LINENO' DEBUG
16
17x=1
18echo "x is $x"
19debug_exit=2
20x=2
21echo "x is $x"
22
23#;;; Local Variables: ***
24#;;; mode:shell-script ***
25#;;; eval: (sh-set-shell "bash") ***
26#;;; End: ***