Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stringZ=" "
- if [[ "$stringZ" == ^[[:blank:]][[:blank:]]*$ ]];then
- echo string is blank
- else
- echo string is not blank
- fi
- string is not blank # wrong
- case $string in
- (*[![:blank:]]*) echo "string is not blank";;
- ("") echo "string is empty";;
- (*) echo "string is blank"
- esac
- if [[ "$stringZ" =~ ^[[:blank:]][[:blank:]]*$ ]];then
- echo string is blank
- else
- echo string is not blank
- fi
- if [[ "$stringZ" =~ ^[[:blank:]]+$ ]]; then
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement