From 2d0967349bd3581a8582d7284d85488404b098ea Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 30 Jan 2017 00:27:44 +0300 Subject: bash.md: `errexit` --- bash.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bash.md b/bash.md index 6f729a0..b50b2fa 100644 --- a/bash.md +++ b/bash.md @@ -51,3 +51,15 @@ It doesn't affect expansion (see below) though. unset -v 'arr["$i"]' # Also rejected. # An insightful discussion on the topic: https://lists.gnu.org/archive/html/help-bash/2016-09/msg00020.html. + +### `errexit` + +#### Do + + bar_output="$( bar )" + foo "$bar_output" + +#### Don't + + foo "$( bar )" # With `errexit`, foo will still get executed. + # I don't know why. -- cgit v1.2.3