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
Post a Comment