Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set -u captures error/warning #4376

Open
ORESoftware opened this issue May 7, 2018 · 3 comments
Open

set -u captures error/warning #4376

ORESoftware opened this issue May 7, 2018 · 3 comments

Comments

@ORESoftware
Copy link

ORESoftware commented May 7, 2018

I have a bash script that calls set -u

I got this error in my terminal

bash: rvm_bash_nounset: unbound variable

not sure if this is expected or not, but if not, maybe look up set -u, I just started playing with it so, just experimenting here. my script had nothing to do with RVM.

The error happened when RVM was sourced by the shell, so common path methinks...

@ORESoftware
Copy link
Author

set -u
This option causes the bash shell to treat unset variables as an error and exit immediately. This brings us much closer to the behavior of higher-level languages.

@gnikonorov
Copy link

@ORESoftware, something in your script ended up calling rvm_bash_nounset. Try adding set -x to your script to print out line by line script execution. This may help pinpoint your issue.

@Vanav
Copy link

Vanav commented Aug 14, 2020

Related: #4342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants