如何比较EFI Shell中两个文件的内容

如何比较EFI Shell中两个文件的内容,shell,uefi,Shell,Uefi,我想比较EFI Shell中两个文件的内容。 我将pci 05 00的内容保存在lan-ref.txt中 我的脚本如下所示: echo -off fs0: pci 05 00 00 -s 0 > lan.txt if lan.txt == lan-ref.txt then reset else echo "LAN not found" endif 我知道“if lan.txt==lan-ref.txt”不起作用,我正在寻找正确的行以实现所需的功能。像@pr

我想比较EFI Shell中两个文件的内容。 我将pci 05 00的内容保存在lan-ref.txt中

我的脚本如下所示:

echo -off
fs0:

pci 05 00 00 -s 0 > lan.txt

if lan.txt == lan-ref.txt then
  reset
else
  echo "LAN not found"
endif

我知道“if lan.txt==lan-ref.txt”不起作用,我正在寻找正确的行以实现所需的功能。

像@prl建议的那样,将
comp
命令和
%lasterror%
组合起来:

comp lan-text lan-ref.txt
if %lasterror% eq 0 then
  reset
else
  echo "LAN not found"
endif

%lasterror%相当于
.bat
脚本中的%errorlevel%,或bourne shells和衍生工具中的
$?

有一个comp命令,但我不知道它是否可以用于if。可能使用%lasterror%?
comp lan-text lan-ref.txt 
if %lasterror% ==0 then 
  reset
else
   echo "LAN not found"
endif