Bash -- DebuggerScript Script-arguments...
Having used to VIM, writing BASH Shell also uses it. Generally, shell is short, so there is no way to improve efficiency, today, I accidentally saw someone mention a bash support plug-in for compiling bash in Vim. I just downloaded it and tried it. It's really powerful.
After the download, follow the instructions to install gvim test. sh opens and you will see the powerful functions in the bash menu. Although most of them are not used, at least I cannot use them. Some syntaxes have not been seen yet, but they can be used as reference manuals ....
Next, we need to debug the function. We need to install bashdb and sudo apt-Get install bashdb. After installation, follow the instructions on the Internet, by default, the bash support plug-in's debugging path is different from the bashdb installation directory. just create a link.
Sai @ Sai-LAPTOP :~ $ Whereis bashdb
Bashdb:/usr/bin/bashdb/usr/share/man/Man1/bashdb.1.gz
Sai @ Sai-LAPTOP :~ $ Sudo mkdir/usr/local/share/bashdb
Sai @ Sai-LAPTOP :~ $ Sudo ln-S/usr/share/bashdb/bashdb-main.inc/usr/local/share/bashdb/bashdb-main.inc
Then OK. Write a shell and start debugging on F9.
Common debugging methods
Run
R restart
W. View nearbyCode
. List currently running code
L m n list the code between M and N rows
B n sets a breakpoint on the nth line
L list all breakpoints
D N deletes the breakpoint of row n
D. Delete all breakpoints.
W var observe VaR
N single-step execution
S one-step execution to enter the Function
P $ var: displays var. It is the most commonly used command.
T observation Stack
Skip skips the command to be executed
After RET is executed, the function returns
FinishProgramEnd
A n cmd executes the CMD command in line N.
A. Cancel all added actions.
Q exit debugging
Detailed bashdb documentation (English)
Http://bashdb.sourceforge.net/bashdb.html#Invocation
Http://lug.fh-swf.de/vim/