S
S
Sergey Pugovkin2018-01-29 19:06:03
bash
Sergey Pugovkin, 2018-01-29 19:06:03

-bash: conditional binary expected -bash: syntax error near "--compare-versions"?

if ; then echo true; else echo false; fi

-bash: conditional binary expected
-bash: syntax error near "--compare-versions"
Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-01-29
@Driver86

What are you going to compare here?
is a standalone operator, not a syntax for conditions
. You need it apparently like this:

if dpkg --compare-versions "1.5.2" "lt" "1.2.11"; then echo true; else echo false; fi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question