Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upbash's local keyword misconception #1092
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
unman
Jul 31, 2015
Member
I've reviewed all bash files under marmarek - I don't see one where this is an issue.
Suggest close.
|
I've reviewed all bash files under marmarek - I don't see one where this is an issue. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
nrgaway
Jul 31, 2015
Interesting. I was wondering why that statement did not fail; that's the reason I mentioned it. In that case I would not want it to fail anyway.
Thanks for the heads up!
nrgaway
commented
Jul 31, 2015
|
Interesting. I was wondering why that statement did not fail; that's the reason I mentioned it. In that case I would not want it to fail anyway. Thanks for the heads up! |
adrelanos
closed this
Jul 31, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
adrelanos commentedJul 29, 2015
There is a common misconception about bash's
localkeyword. I think in #1089 (comment) it's at work.localwill always return0. Yes. That's it. Code talks...script:
output:
If you preferred it fail, you could not write local and the command in question int the same line.
In the example above it probably doesn't matter either way. My point is, if you are using
localelsewhere, where non-zero exit codes matter, consider fixing this. That's all. Once agreed on this, this is closeable, unless you think this needs further work.@nrgaway