1 # kshdb - Korn Shell Debugger main file
2 # adapted from 'Learning the Korn Shell' by Bill Rosenblatt (O'Reilly)
3 # by Cigy Cyriac (cigy@felix.tulblr.unisys.com)
4 # Main driver: constructs full script (with preamble) and runs it
6 echo 'Bourne-Again Shell Debugger version 0.1'
11 echo "${_pname}: usage: ${_pname} <script_file>"
17 [ -r $_guineapig ] || {
18 echo "${_pname}: cannot read $_guineapig." >&2
25 _dbgfile=$_tmpdir/bashdb$$ #temp file for script being debugged
27 cat $_libdir/bashdb.pre $_guineapig > $_dbgfile
28 if [ -f "$BASH" ]; then
29 exec $BASH $_dbgfile $_guineapig $_tmpdir $_libdir "$@"
31 exec bash $_dbgfile $_guineapig $_tmpdir $_libdir "$@"