On 2019-06-24 20:18, Fan, ZhijuX wrote: > Using "-lt" will report the following errors, but "\<" will not > 3.6: integer expression expected > 3.7: integer expression expected > > if [[ "$origin_version" < "$python_version" ]];then > It is equivalent to > if [ "$origin_version" \< "$python_version" ];then > These two approaches work > > Any question, please let me know. Thanks. You might want to extract the major and minor values and compare them separately then. The "<" operator in bash does a string comparison, which I'm not sure is what's wanted here? >From http://tldp.org/LDP/abs/html/comparison-ops.html : < is less than, in ASCII alphabetical order *if [[ "$a" < "$b" ]]* *if [ "$a" \< "$b" ]* Note that the "<" needs to be escaped within a *[ ]* construct. -- Rebecca Cran