Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
scripting:debuggingtips [2016/05/13 15:52]
federated_brackets [Why do CRs hurt?] rewording for accuracy
scripting:debuggingtips [2017/06/07 02:42] (current)
fgrose [Making xtrace more useful] set variables with descriptive words
Line 130: Line 130:
 That helps a lot when the script is long, or when the main script sources many other files. That helps a lot when the script is long, or when the main script sources many other files.
  
 +=== Set flag variables with descriptive words === 
 +If you test variables that flag the state of options, such as with ''​%%if [[ -n $option ]];​%%'',​ consider using descriptive words rather than short codes, such as 0, 1, Y, N, because xtrace will show ''​%%[[ -n word ]]%%''​ rather than ''​%%[[ -n 1 ]]%%''​ when the option is set.
 ===== Debugging commands depending on a set variable ===== ===== Debugging commands depending on a set variable =====
  
  • scripting/debuggingtips.1463154754.txt
  • Last modified: 2016/05/13 15:52
  • by federated_brackets