2N/A#! @builddir@/grub-shell-tester
2N/A#
2N/A# Copyright (C) 2010 Free Software Foundation, Inc.
2N/A#
2N/A# GRUB is free software: you can redistribute it and/or modify
2N/A# it under the terms of the GNU General Public License as published by
2N/A# the Free Software Foundation, either version 3 of the License, or
2N/A# (at your option) any later version.
2N/A#
2N/A# GRUB is distributed in the hope that it will be useful,
2N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2N/A# GNU General Public License for more details.
2N/A#
2N/A# You should have received a copy of the GNU General Public License
2N/A# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
2N/A
2N/Atrue
2N/Aecho $?
2N/A
2N/A! true
2N/Aecho $?
2N/A
2N/Afalse
2N/Aecho $?
2N/A
2N/A! false
2N/Aecho $?
2N/A
2N/A#
2N/A# Negated forms (copied from grub_script_if.in)
2N/A#
2N/A
2N/A#basic if, execute
2N/Aif ! true; then echo yes; fi
2N/A
2N/A#basic if, no execution
2N/Aif ! false; then echo no; fi
2N/A
2N/A#if else, execute if path
2N/Aif ! true; then echo yes; else echo no; fi
2N/A
2N/A#if else, execute else path
2N/Aif ! false; then echo no; else echo yes; fi
2N/A
2N/A#if elif, execute elif
2N/Aif ! false; then echo no; elif ! true; then echo yes; fi
2N/A
2N/A#if elif else, execute else
2N/Aif ! false; then echo no; elif ! false; then echo no; else echo yes; fi
2N/A
2N/A#if elif(1) elif(2), execute elif(2)
2N/Aif false; then echo no; elif ! false; then echo no; elif ! true; then echo yes; fi
2N/A
2N/A#if elif(1) elif(2) else, execute else
2N/Aif false; then echo no; elif false; then echo no; elif ! false; then echo no; else echo yes; fi
2N/A
2N/A#if {if elif else}, execute elif
2N/Aif true; then if false; then echo no; elif ! true; then echo yes; else echo no; fi; fi
2N/A
2N/A#if {if elif} else, execute elif. ofcourse no dangling-else problem due to "fi"
2N/Aif true; then if ! false; then echo no; elif true; then echo yes; fi; else echo no; fi