From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E74FD20336AD0 for ; Mon, 9 Jul 2018 00:18:10 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2018 00:18:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,329,1526367600"; d="scan'208";a="244064550" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 09 Jul 2018 00:17:58 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Jul 2018 00:17:58 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 9 Jul 2018 00:17:58 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.81]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.100]) with mapi id 14.03.0319.002; Mon, 9 Jul 2018 15:17:57 +0800 From: "Gao, Liming" To: krishnaLee CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] question about uefi shell pipe. Thread-Index: AQHUE3e3IO5uFySP7E2mJCQaaR7V+6R+oQqAgAChyQCAAwsMyYAENNJQ Date: Mon, 9 Jul 2018 07:17:56 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2B8A87@SHSMSX104.ccr.corp.intel.com> References: <3009b28c.9942.16464937ab3.Coremail.sssky307@163.com> <22A24D19-CF95-4C30-9939-F2E71DAF3736@apple.com> <1baebc21.151a.16467dca522.Coremail.sssky307@163.com> <34bf3bdd.43b7.1646d5dd393.Coremail.sssky307@163.com> <2c4c067c.593d.1646d8eb20d.Coremail.sssky307@163.com> <6a384354.6433.1646da83e60.Coremail.sssky307@163.com> In-Reply-To: <6a384354.6433.1646da83e60.Coremail.sssky307@163.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: question about uefi shell pipe. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 07:18:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Krishna: Sorry, I am not clear what's your question here? Would you like to share t= his grep.efi tool? Or you meet with the problem in this grep.efi tool? Thanks Liming >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >krishnaLee >Sent: Friday, July 06, 2018 11:35 AM >To: krishnaLee >Cc: edk2-devel@lists.01.org >Subject: Re: [edk2] question about uefi shell pipe. > > > >Hi,All: >may be I should reply this to EDK2 group,I had attached my file again. > > >After many test,my right key of "ls | grep -trim-last 0 | grep -trim-last = 0" is: > 1,before pipe out the buffer,trim off all in-visible wchars at end of th= is buffer, >(the trimed of wchar is "like ASCII's range of" 0x0000~0x0020. ) > 2,always make sure outputBuffer[lastTwoWchar] =3D { 0x000A,0x000D },it w= ill >also bypass many other strange result. > > >thank you, >by krishna. > > > > > >At 2018-07-06 11:07:05, "krishnaLee" wrote: > >Jim, >I attached the smalltest.efi if you have not compiled the test code. > > >I am in developing of this grep.efi tool,I can now bypass the test-1 ques= tion >by follow command: >ls | grep -trim-last 0 >ls | grep -trim-last 0 | grep -trim-last 0 > > >I also attached this grep.efi tool, it almost ok :) > > >//draft usage guide------------------------------------------------- > > >//if find ok,returncode 1,Print(string);else returncode 0; >grep.efi -find string > > >//get first word, >//the front and the end in-visible chars of this word will be trimed off; >grep.efi -first > > >//get back part after the string. > >grep.efi -begin-at string > > >//get front part before the string >grep.efi -end-at string > > >//trim off first n chars at front >//before start -trim-first,the front in-visible chars will be trimed off; >grep.efi -trim-first n > > >//trim off back n chars at end, >//before start -trim-last,the end in-visible chars will be trimed off; >grep.efi -trim-last n > > >//trim off whitespace at front and end, >//trim off in-visible chars infact; >grep.efi -trim-space > > > > >thank you, >by krishna. >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel