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.

Best Regards
Fan Zhiju



-----Original Message-----
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
rebe...@bluestop.org
Sent: Monday, June 24, 2019 11:25 AM
To: devel@edk2.groups.io; Fan, ZhijuX <zhijux....@intel.com>
Cc: Gao, Liming <liming....@intel.com>; Feng, Bob C <bob.c.f...@intel.com>
Subject: Re: [edk2-devel] [PATCH] BaseTools:Linux changes the way the latest 
version is judged

On 2019-06-20 20:33, Fan, ZhijuX wrote:
> -      ret=`echo "$origin_version < $python_version" |bc`
> -      if [ "$ret" -eq 1 ]; then
> +      if [ "$origin_version" \< "$python_version" ]; then
>          origin_version=$python_version
>          export PYTHON_COMMAND=$python
>        fi


I think using the "-lt" operator might be better (more standard). e.g.:


if [ "$origin_version" -lt "$python_version" ]; then



-- 
Rebecca Cran





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#42774): https://edk2.groups.io/g/devel/message/42774
Mute This Topic: https://groups.io/mt/32199579/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to