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.):

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 “pvi.sh” 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):

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up). It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.