File: sig.sh

package info (click to toggle)
bashdb 4.0.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 4,820 kB
  • ctags: 942
  • sloc: sh: 10,581; lisp: 885; makefile: 449; ansic: 325
file content (25 lines) | stat: -rwxr-xr-x 436 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!../../bash
# Signal handling tests
child_handler() {
  echo "child handler called"
}

if [[ "$1"x != x ]] ; then 
  echo "child process $$ here..."
  for (( i=1; i<=1000 ; i++ )) ; do 
    x=`echo b*`
    for (( j=1; j<=1000 ; j++ )) ; do 
      x=`echo t*`
      x=`echo *source*`
    done
  done
  exit 1
fi

# set -x
x=18
# CHLD handler should not be clobbered by debugger.
trap child_handler CHLD
kill -INT $$
kill -INT $$
exit 0