DeveloperWiki:Bash Coding Style

From ArchWiki
Revision as of 16:28, 13 February 2010 by Pierre (Talk | contribs) (Created page with '* indent with tabs * tabs have 8 characters * don't use more than 132 columns * opening braces are top right, closing are bottom left: <pre> foo() { echo bar } </pre> * i…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • indent with tabs
  • tabs have 8 characters
  • don't use more than 132 columns
  • opening braces are top right, closing are bottom left:
foo() {
        echo bar
}
  • if and for statements are like this:
if true; then
        do something
else
        do something else
fi
for i in a b c; do
        echo $i
done
  • use single quotes if a string does not parseable content
  • use source instead of .