-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Equivalent of bash set -e #3415
Copy link
Copy link
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics
Milestone
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Languageparser, language semanticsparser, language semantics
I asked this question on twitter and it was suggested I post here.
Many people consider it good practice to start a bash script.
set -etells the script to stop on first errorset -utells the script to not allow undeclared variablesAlthough not everyone agrees
I think
set -uandSet-StrictMode -Version 1.0are equivalent.I just wrote a set of Powershell scripts for managing an elasticsearch server. Then a few top-level scripts to tie them together.
It would have been really useful to be able to write something equivalent to...
... but I couldn't find how to and ended up with something more like...
Apologies if this is already possible and I've missed it...