Comparing PHP version numbers using Bash?

前端 未结 10 1061
余生分开走
余生分开走 2020-12-02 13:30

I have this script that should make sure that the users current PHP version is between a certain range, though it SHOULD work, there is a bug somewhere that makes it think t

10条回答
  •  春和景丽
    2020-12-02 13:58

    There is possibility for deb-distributions:

    dpkg --compare-versions   
    

    For example:

    dpkg --compare-versions "0.0.4" "gt" "0.0.3"
    if [ $? -eq "0" ]; then echo "YES"; else echo "NO"; fi
    

提交回复
热议问题