![]() ![]() ![]() Using the set Bash built-in you can run in normal mode those portions of the script of which you are sure they are without fault, and display debugging information only for troublesome zones. ![]() These debugging features are available in most modern versions of Bash, starting from 3.x.Ģ.3.2. There is now a full-fledged debugger for Bash, available at SourceForge. echo 'I'\''m giving you back your prompt now.' echo 'I'\''m setting two variables now.' I will now fetch you a list of connected users:Ĥ:50pm up 18 days, 6:49, 4 users, load average: 0.58, 0.62, 0.40 echo 'I will now fetch you a list of connected users:' Note again that the added comments are not visible in the output of the script. This is the commented-script1.sh script ran in debug mode. Traces of each command plus its arguments are printed to standard output after the commands have been expanded but before they are executed. The most common is to start up the subshell with the -x option, which will run the entire script in debug mode. Bash provides extensive debugging features. When things don't go according to plan, you need to determine what exactly causes the script to fail.
0 Comments
Leave a Reply. |