I have an expression like this in a bash file:
MY_NEW_VAR="path/${MY_VARIABLE:?}"
What does :? operator mean?
I have an expression like this in a bash file:
MY_NEW_VAR="path/${MY_VARIABLE:?}"
What does :? operator mean?
If $MY_VARIABLE
exists and isn't null, return it's value.
If it doesn't exist, or is null, print the error message you're able to set.
MY_NEW_VAR='path/${MY_VARIABLE:?"error message"}'
If no error message is given, it return parameter null or not set
.