if statement - How to test in bash one or two conditions -


I have to check that there is nothing else but a variable:

  a = "6"; If ["$ a"! = "6"] || ["$ A"! = "4"]; Then echo "OK";  

Returns: OK

I just do not get it ...? !!

try

  if ["$ a"! = "6" -o "$ a"! = "4"] ...   

But it is not understood that this condition is always true ($ 4 can not be 4 and 6 at the same time). You might want to:

  instead of  and  if ["$ a"! = "6" -a "$ a"! = "4"] ...    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -