ATT Live 2012 Session Spotlight–Bash Debugging


Note: To see a list of all the sessions planned for ATT Live 2012, go to

To give you a taste of the learning you can expect to experience at ATT Live 2012, over the next month or so, I’ll be posting as many session spotlights as I can. This first Session Spotlight post, on Bash Debugging, comes from Brandon Heaton (see Brandon’s bio at the bottom).

His reason for creating this session is, “Automation with Bash is an essential skill for Advanced System Administrators. As your scripts grow in size and complexity, advanced debugging becomes more essential to managing your large project code.”

Here’s one of the topics Brandon is going to present in the Bash Debugging session:

Want to know a simple and effective insider secret for Bash debugging? Just add the following alias to your ~/.bashrc file, and Bash debugging becomes that much easier (as does debugging of Tcl, C, Python, etc.):

alias"vim -c 'let g:sh_fold_enabled=7' -c ':set fdm=syntax' -c 'sy on'"

Enter “source ~/.bashrc” at the command line.

Then, rather than launching your Bash editing session like this…

…launch it with your new alias instead:

You’ll notice that folding is turned on and automatically folds your functions and control structures.

You’ll also notice that syntax hi-lighting is turned on, which is a key feature for debugging code.

Not sure why you are getting an error? In your “” session, jump to the line showing the error and look at the coloring and placement of code, based on the syntax hi-lighting. For example, if all your code in that region is red (but shouldn’t be, based on the syntax) there is good chance that a closing quote is missing in the code. Perhaps it is a missing closing control structure reserved word, etc.

Syntax hi-lighting is available with the default vi (Vim) that ships with SUSE Linux Enterprise 11 (desktop and server), and is just one of several Bash debugging techniques taught at ATT Live this year.

Hope to see you in Vegas in March! There is going to be a lot of excellent instruction and exciting innovations in SUSE Training and Certification.

P.S. If you’re looking for good XML editing for your Autoyast XML files, try this Vim alias on for size (best raw XML editing method I have yet seen):

alias pvi.xml="vim -c 'let g:xml_syntax_folding = 1' -c ':set fdm=syntax' -c 'sy on'"

The built-in help for Vim will tell you more about “folding” to get you started in editing code, tags, visual blocks, etc.


Brandon Heaton’s Brief Bio:

  • 15 years working with Linux and Windows from the data center to the workstation
  • Unix DB Admin for 5+ years prior to Novell
  • 9 years working for Novell: 3 years in Technical Support, 6 years in Training Services
  • Training services Subject Matter Expert and Data Center Engineer, with strong focus on:
    • SUSE Linux Enterprise Server and Desktop
    • Enterprise Bash Programming
    • High Performance Administration (HPA)
    • SUSE Architecture and Deployment
    • Technical Training Design, Development and Delivery
    • Windows Workstation Optimization
  • I created and maintain an Open Source HPA Project released by Novell called “Mooty”
(Visited 1 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

No comments yet