Krishna: Sorry, I am not clear what's your question here? Would you like to share this grep.efi tool? Or you meet with the problem in this grep.efi tool?
Thanks Liming >-----Original Message----- >From: edk2-devel [mailto:[email protected]] On Behalf Of >krishnaLee >Sent: Friday, July 06, 2018 11:35 AM >To: krishnaLee <[email protected]> >Cc: [email protected] >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 this > buffer, >(the trimed of wchar is "like ASCII's range of" 0x0000~0x0020. ) > 2,always make sure outputBuffer[lastTwoWchar] = { 0x000A,0x000D },it will >also bypass many other strange result. > > >thank you, >by krishna. > > > > > >At 2018-07-06 11:07:05, "krishnaLee" <[email protected]> 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 question >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 >[email protected] >https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

