Hi,liming:
the files attached to this mail may be missed,so I had made a copy here:
https://github.com/testcheng307/UEFI-TEST
the question is in first mail,I repeat it here:
# test-1,the follow two command should has the same output ,but infact not the
same in QEMU,and the second command failed WriteFile in real machine(AMI bios
uefi 2.6):
# the smalltest.efi 's fullsource code is in my first mail;
ls | smalltest.efi
ls | smalltest.efi | smalltest.efi
#test-2
run smalltest.efi,
just key in some chars, and I can not end input by press Enter or[Ctrl+C] or
[Ctrl+Z], so nothing output,why?
#test-3,the follow two command will be the same.
ls | grep -trim-last 0
ls | grep -trim-last 0 | grep -trim-last 0
# my grep.efi tool will process input buffer like this:
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-09 15:17:56, "Gao, Liming" <[email protected]> wrote:
>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