bash coding standards
Are there any bash coding standards on the 'net or otherwise available? I can't find any and don't recall ever seeing any.
|
You can find some bash coding guidelines at: http://wiki.bash-hackers.org/scripting/style
Quote:
|
The standards it follows are those defined for POSIX sh. But it also has extensions in addition to that. A few things in bash are not 100% POSIX sh compliant, but bash can be invoked in a way that it is.
Quote:
Topic for #bash is "FAQ: http://mywiki.wooledge.org/BashFAQ | Guide: http://mywiki.wooledge.org/BashGuide | ref: http://xrl.us/bhk9ww | http://wiki.bash-hackers.org/ | USE MORE QUOTES!: http://www.grymoire.com/Unix/Quote.html | Scripts and more: http://www.shelldorado.com/ | Bug mailing list: http://tx0.org/3af | New official help mailing list: http://tx0.org/31f | Devel branch: http://xrl.us/bmodjy" |
Advanced Bash-Scripting Guide can contain some useful info for you:
http://www.tldp.org/LDP/abs/html/index.html |
Thanks rosehosting.com, that is exactly what I am looking for :)
Thanks fakie_flip but it is coding standards not language standards I am looking for :) Thanks steelneck :) ABS does have "Chapter 35, Scripting With Style" but it has only one section: 35.1. Unofficial Shell Scripting Stylesheet and that looks like an early draft. |
You know, I don't like that style guide. However, I can't really provide a good style guide. In bash it's not too important, because it's mostly readable. You know maybe I'll write my own style guide and put it on a wiki somewhere.
|
That's the great thing about standards -- if you don't like them you can write your own :rolleyes:
Seriously, it's nice to have a starting point and I'm happy with most of the Bash Hackers Wiki's page. Since the OP, I found bash "good practice" guides at the well known Greg's WIKI and at Hall of Tips. All good stuff. A bash "coding standard", "style guide" or "good practice guide" could usefully also suggest some defensive commands: Code:
# Configure shell environment |
All times are GMT -5. The time now is 01:57 AM. |