Debugging is an essential part in the debugging technology programming of Shell scripts. It is desirable to use its powerful functions. Of course, its strength is not only reflected in the implementation function of the language, but also its debugging function. below, I will explain the debugging technology of Shell scripts through examples. The following is an example I used: [python] #! /Bin/bash LINE = "Tests run: 196, Failures: 1, Errors: 1" error = 'echo $ LINE | cut-d ': '-f4' echo $ error ERROR = 0 ERROR = $ ($ error + $ ERROR) echo $ ERROR there are two methods to run this example: 1. add the execution permission chmod a + x sleep to the file. run sh sleep as the command line parameter. sh running result is shown in: we can see that only the execution result is displayed here. What should I do if I want to know how the script is executed? You can also use the following two methods: 1. Add the corresponding bash-x sleep. sh2. Add the corresponding information at the beginning of the script file [python] #! /Bin/bash-xv LINE = "Tests run: 196, Failures: 1, Errors: 1" error = 'echo $ LINE | cut-d ': '-f4' echo $ error ERROR = 0 ERROR =$ ($ error + $ ERROR )) echo $ ERROR: we can see that-xv is added to the first line. Let's run this script again. The result is as follows: I have finished debugging the Shell script here.