Oct 19, 2016

[bash] [ test

Why do I need to quote variable for if

What is the difference between [[ $a == z* ]] and [ $a == z* ]?

Bash ADV


  • 0xff or o12 does not evaluated in [ command
  • always quote variables in [ command
  • never use the -a or -o operator (use several [ commands and the && and || shell operators)
  • The whole [[ ... ]] construct makes up a command.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.