-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PowerVS: Handle bash: master: unbound variable error
Handle the following error: bash: master: unbound variable There is some weird interaction with pattern match deletion and the test operator. hamzy:hamzy-release$ (set -u; BRANCH="master"; [[ "${BRANCH#4.}" -ge 13 ]] && echo yes) bash: master: unbound variable The fix is to also test for master before the pattern match deletion. hamzy:hamzy-release$ (set -u; BRANCH="master"; [[ ( "${BRANCH}" == "master" ) || ( "${BRANCH#4.}" -ge 13 ) ]] && echo yes) yes hamzy:hamzy-release$ (set -u; BRANCH="4.17"; [[ ( "${BRANCH}" == "master" ) || ( "${BRANCH#4.}" -ge 13 ) ]] && echo yes) yes hamzy:hamzy-release$ (set -u; BRANCH="4.10"; [[ ( "${BRANCH}" == "master" ) || ( "${BRANCH#4.}" -ge 13 ) ]] && echo yes) Also use consistent indentation.
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters