settrace.sh

来自「bash debugger. You can use this tool to 」· Shell 代码 · 共 36 行

SH
36
字号
#!/bin/bash# Towers of Hanoiinit() {  _Dbg_set_trace; : ; :}hanoi() {   local -i n=$1  local -r a=$2  local -r b=$3  local -r c=$4  _Dbg_set_trace; : ; :  if (( n > 0 )) ; then    (( n-- ))    hanoi $n $a $c $b    ((disc_num=max-n))    echo "Move disk $n on $a to $b"    if (( n > 0 )) ; then       hanoi $n $c $b $a    fi  fi}if [[ -n $1 ]] ; then  builddir=$1elif [[ -z $builddir ]] ; then  builddir=`pwd`/..fisource ${builddir}/bashdb-trace -q -L .. -B  -x settrace.cmdtypeset -i max=1inithanoi $max "a" "b" "c"_Dbg_set_trace _Dbg_do_quit; : ; :

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?