[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to suppress error messages of the command "search"?

From: Steven Shiau
Subject: How to suppress error messages of the command "search"?
Date: Thu, 12 Jul 2018 08:39:12 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Dear all,
I am writing a grub config file to search boot loader for uEFI for
network booting. This is the content:

menuentry "Local operating system" --id local-disk {
  echo "Trying to boot from local disk..."
  if search --no-floppy --file --set=root /EFI/redhat/grub.efi; then
    chainloader /EFI/redhat/grub.efi +1
  elif search --no-floppy --file --set=root /EFI/Boot/bootx64.efi; then
        chainloader /EFI/Boot/bootx64.efi +1
    echo "No uEFI image was found!"
    sleep 15

However, I'd like to suppress the error messages about search command.
Is any option I can use so that search command won't show error messages
when the file is not found, i.e., I'd like to suppress these error messages:
error: no such device: /EFI/redhat/grub.efi.
error: no such device: /EFI/Boot/bootx64.efi
Thank you very much.


Steven Shiau <steven _at_ stevenshiau org>
Public Key Server PGP Key ID: 4096R/163E3FB0
Fingerprint: EB1D D5BF 6F88 820B BCF5  356C 8E94 C9CD 163E 3FB0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]