Last active
September 1, 2015 00:28
-
-
Save peijiehu/4f744780b9b175a39cc0 to your computer and use it in GitHub Desktop.
Shell: check whether a variable contains certain string or not
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
# to check whether TEST_OPTIONS contains "-P" or "--parallel", or not | |
# TEST_OPTIONS can be "-P 20", "--parallel=15", or any string | |
if [[ "$TEST_OPTIONS" == -P* ]] || [[ "$TEST_OPTIONS" == --paralell* ]]; then echo "yes"; else echo "no"; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment