diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-11-10 15:25:23 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-11-10 15:25:23 +0100 |
commit | aa727b8868b428a6b75e0d48a854be65242b257c (patch) | |
tree | 37be2eeff0f50effca07977eec99b7b5364bdddb /STYLE-GUIDE.txt | |
parent | ba7820b18c0ee8631505f7a2a764f7222a732d44 (diff) | |
download | app.sh-aa727b8868b428a6b75e0d48a854be65242b257c.tar.gz app.sh-aa727b8868b428a6b75e0d48a854be65242b257c.tar.bz2 app.sh-aa727b8868b428a6b75e0d48a854be65242b257c.tar.xz app.sh-aa727b8868b428a6b75e0d48a854be65242b257c.zip |
Diffstat (limited to 'STYLE-GUIDE.txt')
-rw-r--r-- | STYLE-GUIDE.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/STYLE-GUIDE.txt b/STYLE-GUIDE.txt index 77dce24..4eab7c2 100644 --- a/STYLE-GUIDE.txt +++ b/STYLE-GUIDE.txt @@ -43,8 +43,21 @@ usage_text() { Executing Commands ================== +When chaining commands look at `pipefail`. + * http://unix.stackexchange.com/q/23026 +If you want to fail this shell if a sub-shell fails, use this form: + +---------------------------------------------------------------------- +ENV=$(app conf get app.env) || false +---------------------------------------------------------------------- + +The sub-shell will exit with a non-zero exit code, but even with `-e` +set bash won't exit the current shell. + +See also http://www.fvue.nl/wiki/Bash:_Error_handling. + Parsing options =============== |