Source From Here
QuestionI have a string in Bash:
- string="My string"
HowTo
You can use Marcus's answer (* wildcards) outside a case statement, too, if you use double brackets:
- string='My long string'
- if [[ $string == *"My long"* ]]; then
- echo "It's there!"
- fi
沒有留言:
張貼留言