📄 parm.right
字号:
(parm.sh:26):26: x="main"+# Debugger test of:+# stack trace+# parameter display+# return command+# evaluation of dollar variables $1, $2+# +### Try a simple stack command...+where ->0 in file `parm.sh' at line 26##1 source("parm.sh") called from file `bashdb' at line 277##2 main() called from file `bashdb' at line 0+step 2(parm.sh:3):3: fn1() {+where ->0 in file `parm.sh' at line 3##1 fn1("5") called from file `parm.sh' at line 27##2 source("parm.sh") called from file `bashdb' at line 277##3 main() called from file `bashdb' at line 0+### Try printing a dollar variable...+p $15+### Same thing using eval...+eval echo $15+### Setting an action to print $1+a 4 echo "\$1 at line 4 has value $1"Breakpoint 0 set at parm.sh:4.+c fn2One-time breakpoint 1 set in file parm.sh, line 14.$1 at line 4 has value 5$1 at line 4 has value 4$1 at line 4 has value 3$1 at line 4 has value 2$1 at line 4 has value 1$1 at line 4 has value 0(parm.sh:14):14: fn2() {+# cont+### First parameter should have embedded blanks...+where ->0 in file `parm.sh' at line 14##1 fn2("testing 1", "2 3") called from file `parm.sh' at line 6##2 fn1("0") called from file `parm.sh' at line 10##3 fn1("1") called from file `parm.sh' at line 10##4 fn1("2") called from file `parm.sh' at line 10##5 fn1("3") called from file `parm.sh' at line 10##6 fn1("4") called from file `parm.sh' at line 10##7 fn1("5") called from file `parm.sh' at line 27##8 source("parm.sh") called from file `bashdb' at line 277##9 main() called from file `bashdb' at line 0+p "dollar 1: $1"dollar 1: testing 1+### Same thing using eval...+e echo "\$1 is $1"$1 is testing 1+### Should have embedded blanks...+p $22 3+e echo "\$2 is $2"$2 is 2 3+continue fn3One-time breakpoint 2 set in file parm.sh, line 21.fn2: testing 1 2 3(parm.sh:21):21: fn3() {+### Test return. Should go back to fn2 and then fn1...+return (parm.sh:18):18: x="fn2 returning"+return (parm.sh:7):7: return+### Should not have done above-listed x="fn2" assignment+p $xfn2 started+where ->0 in file `parm.sh' at line 7##1 fn1("0") called from file `parm.sh' at line 10##2 fn1("1") called from file `parm.sh' at line 10##3 fn1("2") called from file `parm.sh' at line 10##4 fn1("3") called from file `parm.sh' at line 10##5 fn1("4") called from file `parm.sh' at line 10##6 fn1("5") called from file `parm.sh' at line 27##7 source("parm.sh") called from file `bashdb' at line 277##8 main() called from file `bashdb' at line 0+return (parm.sh:11):11: x="fn1 returning"+where ->0 in file `parm.sh' at line 11##1 fn1("1") called from file `parm.sh' at line 10##2 fn1("2") called from file `parm.sh' at line 10##3 fn1("3") called from file `parm.sh' at line 10##4 fn1("4") called from file `parm.sh' at line 10##5 fn1("5") called from file `parm.sh' at line 27##6 source("parm.sh") called from file `bashdb' at line 277##7 main() called from file `bashdb' at line 0+return (parm.sh:11):11: x="fn1 returning"+where ->0 in file `parm.sh' at line 11##1 fn1("2") called from file `parm.sh' at line 10##2 fn1("3") called from file `parm.sh' at line 10##3 fn1("4") called from file `parm.sh' at line 10##4 fn1("5") called from file `parm.sh' at line 27##5 source("parm.sh") called from file `bashdb' at line 277##6 main() called from file `bashdb' at line 0+return (parm.sh:11):11: x="fn1 returning"+return (parm.sh:11):11: x="fn1 returning"+where ->0 in file `parm.sh' at line 11##1 fn1("4") called from file `parm.sh' at line 10##2 fn1("5") called from file `parm.sh' at line 27##3 source("parm.sh") called from file `bashdb' at line 277##4 main() called from file `bashdb' at line 0+### * Testing that exit status preserved on eval and print...+c 29One-time breakpoint 3 set in file parm.sh, line 29.(parm.sh:29):29: exit 0+e echo "eval says exit was $?"eval says exit was 5+p "print says exit was $?"print says exit was 5+info filesSource files for which have been read in:parm.sh (34 lines)+### * quitting...+quit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -