azet / community_bash_style_guide

Community Bash Style Guide: writing useful and modern bash scripts, seriously.
Creative Commons Attribution 4.0 International
298 stars 37 forks source link

small typo & cat replacement section #1

Closed berqavos closed 10 years ago

berqavos commented 10 years ago

found a small typo under section printf and added new section "you dont't need cat"

azet commented 10 years ago

very well. thanks.

azet commented 10 years ago

just a quick note, I've changed your code a bit. see: https://github.com/azet/community_bash_style_guide/commit/6807c491157d8f7d8d9ce2fafc8b1ce77718cd01

printf should be used like a printf statement in any other language (i.e. don't pass stuff directly, but with proper formatting, i.e. as string, int, float,..). readonly is pretty much reserved for constants, since batterystatus is something that might change over time, I've replaced this with the usual variable assignment.

BTW: the way that this works is that the output of a subshell is directly passed into the assignment of a variable, it's not a replacement for cat in all cases, but can usually be used to replace cat for passing stuff into variables.

berqavos commented 10 years ago

ok, thx.