[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: local assigned from command substitution disobeys set -eu
From: |
Greg Wooledge |
Subject: |
Re: local assigned from command substitution disobeys set -eu |
Date: |
Tue, 30 Dec 2014 09:40:47 -0500 |
User-agent: |
Mutt/1.4.2.3i |
On Tue, Dec 30, 2014 at 02:03:01PM +0200, Ville Oikarinen wrote:
> I often use "set -eu" to make my scripts more robust by exiting when
> there are errors.
http://mywiki.wooledge.org/BashFAQ/105
> But one of my scripts just kept on running after failures. I found out
> that the keyword "local" does not obey it.
Cool, another one to add to the wiki page! I am always excited by new
weapons in the never-ending war against set -e.
This particular issue was also already noted in a more general context on
http://mywiki.wooledge.org/BashPitfalls -- see entry #27.