Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. stringZ=" "
  2.  
  3. if [[ "$stringZ" == ^[[:blank:]][[:blank:]]*$ ]];then
  4. echo string is blank
  5. else
  6. echo string is not blank
  7. fi
  8.  
  9. string is not blank # wrong
  10.  
  11. case $string in
  12. (*[![:blank:]]*) echo "string is not blank";;
  13. ("") echo "string is empty";;
  14. (*) echo "string is blank"
  15. esac
  16.  
  17. if [[ "$stringZ" =~ ^[[:blank:]][[:blank:]]*$ ]];then
  18. echo string is blank
  19. else
  20. echo string is not blank
  21. fi
  22.  
  23. if [[ "$stringZ" =~ ^[[:blank:]]+$ ]]; then
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement