e5ca5a6b5ddfed9d0e4e5ef11b34db7bff2605f1
compute/bash-gotchas.md
| ... | ... | @@ -2,9 +2,9 @@ |
| 2 | 2 | This kind of shit is why sysadmins drink. |
| 3 | 3 | |
| 4 | 4 | ### (( )) can return false |
| 5 | -[Iff](https://en.wikipedia.org/wiki/If_and_only_if) the expression in `(( blah ))` evaluates to 0, the `(( ))` returns false, so your `set -e` script will fall on its arse. |
|
| 5 | +[Iff](https://en.wikipedia.org/wiki/If_and_only_if) the expression in `(( blah ))` evaluates to 0, the `(( ))` returns false, so your `set -e` script will fall on its arse. Best of luck to you. |
|
| 6 | 6 | |
| 7 | -### pipes into read can return false |
|
| 8 | -In some old versions of bash (e.g. RHEL6), piping commands into `while read -r blah` will fail at the end of the stream, so `set -e` will make a mockery of you. |
|
| 7 | +### pipes into read can return false for no reason |
|
| 8 | +In some old versions of bash (e.g. RHEL6), piping commands into `while read -r blah` from the left will return false unchecked at the end of the stream, so `set -e` will make a mockery of you. |
|
| 9 | 9 | |
| 10 | -Use `while read -r blah; do something; done < <(command>)` instead. |
|
| 10 | +Use `while read -r blah; do something; done < <(command>)` instead. |