LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Syndicated Linux News (https://www.linuxquestions.org/questions/syndicated-linux-news-67/)
-   -   LXer: Writing Better Shell Scripts – Part 1 (https://www.linuxquestions.org/questions/syndicated-linux-news-67/lxer-writing-better-shell-scripts-%96-part-1-a-814328/)

LXer 06-15-2010 02:20 PM

LXer: Writing Better Shell Scripts – Part 1
 
Published at LXer:

This post is the first in a series on shell script debugging, error handling, and security. Although I’ll be presenting some methodologies and techniques that apply to all shell languages (and most programming languages), this series will focus very heavily on BASH. Users of other shells like CSH will need to do some homework to see what information transfers and what does not. One of the difficulties with debugging a shell script is that BASH typically doesn’t give you very much information to go on. You might get error output showing a line number, but that’s just the line where the shell became aware of the error, not necessarily the line where the error actually occurred. Add in a vague error message such as the one in Listing 1, and it gets difficult to tell what’s going on inside your script.

Read More...


All times are GMT -5. The time now is 10:58 PM.