搜尋此網誌

2014年9月8日 星期一

EFI Shell commands -- PARSE(在一個標準格式裡,從記錄輸出擷取一個值)

Retrieves a value from a record output in a standard format.

parse filename tablename column [-i ] [-s ]
filename        Source file name
tablename       The name of the table being parsed.
column          The one-based column index to use to determine which value
                from a particular record to parse.
-i   Start parsing with the nth instance of specified tablename,                 after the specified instance of ShellCommand. If not present,
                then all instances will be returned.
-s   Start parsing with the nth instance of the ShellCommand table.                If not present, then 1 is assumed.
This command will enable the parsing of data from a file which contains data which has been output from a command having used the -sfo parameter. Since the standard formatted output has a well known means of parsing, this command is intended to be used as a simplified means of having scripts consume such constructed output files and use this retrieved data in logic of the scripts being written for the UEFI shell.
The following data is contained in a temporary file (temp.txt):
VolumeInfo, "MikesVolume","400000000","32000000","16000000"
FileInfo, "fs0:/efi/boot/winloader.efi","45670","arsh"
FileInfo, "fs0:/efi/boot/mikesfile.txt","1250","a"
FileInfo, "fs0:/efi/boot/readme.txt","795","a"
The following shows the parse command being used:
MikesVolume

Below is an example using the Index parameter:

fs0:\〉parse temp.txt FileInfo 3 -i 3

沒有留言:

張貼留言