source: vendor/bash/3.1-p17/tests/dbg-support2.tests

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 441 bytes
Line 
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: ***
Note: See TracBrowser for help on using the repository browser.