comparison - What is wrong in the following conditional expression in bash? -


what wrong in following conditional expression in bash?

if [[ -z $x -o $x -ge 100 -o $x -le -100 ]];         echo $x "\t" $i fi 

i following error
syntax error in conditional expression
syntax error near -o

thanks.

just use || this:

if [[ -z $x || $x -ge 100 || $x -le -100 ]]; 

the [ synonym test -- in fact, in systems, /bin/[ points /bin/test:

$ [ /usr/local/bin/[ 

the -o flag test or

the -o flag [[ (the bash builtin) checks if shell option set [e.g. -o vi vi editing]


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -