From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: zhijux.fan@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Mon, 24 Jun 2019 19:18:31 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jun 2019 19:18:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,413,1557212400"; d="scan'208";a="188121126" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 24 Jun 2019 19:18:30 -0700 Received: from shsmsx153.ccr.corp.intel.com (10.239.6.53) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 24 Jun 2019 19:18:30 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.87]) by SHSMSX153.ccr.corp.intel.com ([169.254.12.76]) with mapi id 14.03.0439.000; Tue, 25 Jun 2019 10:18:28 +0800 From: "Fan, ZhijuX" To: "rebecca@bluestop.org" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Feng, Bob C" Subject: FW: [edk2-devel] [PATCH] BaseTools:Linux changes the way the latest version is judged Thread-Topic: [edk2-devel] [PATCH] BaseTools:Linux changes the way the latest version is judged Thread-Index: AdUn2a1I5GjkZ+HKSWepRU50T/llRwCH7iWAAEASgAA= Date: Tue, 25 Jun 2019 02:18:27 +0000 Message-ID: References: <2008e91f-4144-80dd-3632-1298cb054384@bluestop.org> In-Reply-To: <2008e91f-4144-80dd-3632-1298cb054384@bluestop.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhijux.fan@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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= cca@bluestop.org Sent: Monday, June 24, 2019 11:25 AM To: devel@edk2.groups.io; Fan, ZhijuX Cc: Gao, Liming ; Feng, Bob C Subject: Re: [edk2-devel] [PATCH] BaseTools:Linux changes the way the late= st version is judged On 2019-06-20 20:33, Fan, ZhijuX wrote: > - ret=3D`echo "$origin_version < $python_version" |bc` > - if [ "$ret" -eq 1 ]; then > + if [ "$origin_version" \< "$python_version" ]; then > origin_version=3D$python_version > export PYTHON_COMMAND=3D$python > fi I think using the "-lt" operator might be better (more standard). e.g.: if [ "$origin_version" -lt "$python_version" ]; then --=20 Rebecca Cran