Comments (2)
FYI, workaround is using trap -- '...'
.
from shellcheck.
Thank you Taiki - that workaround is simpler, but I don't understand this well enough to suggest a wiki change for other people:
#!/bin/bash
set -uo pipefail
trap -- 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
IFS=$'\n\t'
echo "Example of strict bash mode from Michael Daffin, see"
echo "https://olivergondza.github.io/2019/10/01/bash-strict-mode.html"
We can probably close this issue.
from shellcheck.
Related Issues (20)
- shell-test
- shellcheck-v0.10.0.linux.riscv64.tar.xz is actually gzipped, not xz'd HOT 1
- /bin/dash detect error
- [QUESTION] is xargs also a solution to sc2089, sc2090? HOT 2
- [SC2312] triggers for return in a condition HOT 2
- SC2116 (Useless echo?) and SC2046 (prevent word splitting) should not apply if in case of SC2327 (command substitution will be empty). HOT 2
- Local variable escaped from the function
- sh
- SC2317 false positives on scripts run with `source` and having `return` as its last command
- [Feature request] Is it time to deprecate UUOC (SC2002)? HOT 3
- SC1089: bash: coproc "NAME" { ...; } - quoted NAME kills parsing HOT 1
- SC2086 - False positive in multi-line quoted string HOT 3
- Would you consider adding the appropriate changelog fragment to the releases when releasing?
- [SC2120] False positive when a function is called by `trap` with arguments HOT 2
- Incorrect handling of the source command
- SC2329 should be transitive HOT 2
- [SC2295] Example itself is problematic. HOT 1
- [SC2317] False positive with nested functions
- SC3045: Inconsistent policy
- SC2086: variable from the braces expand loop `for i in {0..10}`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shellcheck.