Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16332

Re: bash errexit shell option does not work in some cases.

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: bash errexit shell option does not work in some cases.
Date Sun, 31 May 2020 22:46:48 -0400
Lines 69
Approved bug-bash@gnu.org
Message-ID <mailman.870.1590979632.2541.bug-bash@gnu.org> (permalink)
References <3f403934d6b5d23ca58afc5146416c7@cweb006.nm.nfra.io> <5a7df0ba-3ad1-1f35-1107-09fdd5950359@archlinux.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EIWBViG2hY1nwpOJBYQukilbbuidbrePG"
X-Trace usenet.stanford.edu 1590979633 16034 209.51.188.17 (1 Jun 2020 02:47:13 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
X-Spam-BL-Results
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1590979617; bh=dXrqV5xoSCkjpCHTNY7P+pLGRkM+od/JdjA+CPHCFfQ=; h=Subject:To:References:From:Date:In-Reply-To; b=TPH4P8mq7kY1j8eMhG8CAB4AxNFfnlA9L9IUolwzbWl2CVZnvD/eYhNki8CBSPGsf NsB7krVz9vkdWZod8WaArh8Ez6C/33WmHVtaa4+AZ0oD8sFOMAPdNtOun41Cz7p91o Xu2r66m4mwEuWornZ18+zSyxsHEkYqDUIoV3v82Gbh2dpVUQBbBUVCxKnqBmO1xxvR sqG7g8YU+QEM8H4isMsSM81IQEQPUtifpobpqTs5T/AilYpSLvUvwKgh9pmuXEEGR4 Sh66VthRfLUqTrPJX45b6dvjoVw4L/gVpXHxDGYAVU/rwuaiCgDEYQ8q3BLYLv0yX4 PmPf76dC+WeBMf/DWXrRIi3JUx8axp9yLglVxxvfWorcjJ3Tjql1vn5QVcbGpK2LBR fhJugpFwur3bhz3ppwAz65JwhmKyqnie77oyvXUR/h/8M/1KEFWJHlPA4uCc6xP8XS +kni39nPi2RJOIebAmIFiL7BV3eeQefuV+EkQHOHEh00hMIN59fECcKLOrgqBGiaza U9R5RZpe6EumYGHhBGzod0942JYhhjDwLYL9N9gFtkIjdjni80DCltwg8T4zIdWopZ KprCrn1Rv2sWr+XCPH16T0QCn1/oKS28kNg9gKXcIETLf1ffCVZzTVyi5WHosuyGOl 1ZkBGH1wftsfdR69ciUn5W2k=
X-Clacks-Overhead GNU Terry Pratchett
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0
In-Reply-To <3f403934d6b5d23ca58afc5146416c7@cweb006.nm.nfra.io>
Received-SPF pass client-ip=2a01:4f8:160:6087::1; envelope-from=eschwartz@archlinux.org; helo=orion.archlinux.org
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -43
X-Spam_score -4.4
X-Spam_bar ----
X-Spam_report (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <5a7df0ba-3ad1-1f35-1107-09fdd5950359@archlinux.org>
X-Mailman-Original-References <3f403934d6b5d23ca58afc5146416c7@cweb006.nm.nfra.io>
Xref csiph.com gnu.bash.bug:16332

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 5/31/20 10:32 PM, Hyunho Cho wrote:
> 
> GNU bash, version 5.0.16(1)-release (x86_64-pc-linux-gnu)
>  Operating System: Ubuntu 20.04 LTS
>  Kernel: Linux 5.4.0-33-generic
>  Architecture: x86-64
> 
> 
> bash errexit shell option does not work in some cases.
> after execution a command, exitcode is set to "1" but shell script does not exited.
You're merely the latest person to discover that this applies to you:
http://mywiki.wooledge.org/BashFAQ/105

tl;dr
Don't use errexit, it does not mean what you think it does.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: bash errexit shell option does not work in some cases. Eli Schwartz <eschwartz@archlinux.org> - 2020-05-31 22:46 -0400

csiph-web