My code below doesn't work:
stringZ=" "
if [[ "$stringZ" == ^[[:blank:]][[:blank:]]*$ ]];then
echo string is blank
else
echo string is not blank
fi
Result:
string is not blank # wrong
How can I test this?
|
My code below doesn't work:
Result:
How can I test this? |
||||
|
|
|
No need for
|
|||
|
|
|
From
So the regular expression matching operator should be
You can reduce the verbosity of the regular expression by using
|
||||
|
|