hp workstations zx6000, hp server rx2600 - operation and maintenance guide

System Configuration
Extensible Firmware Interface (EFI)
Chapter 3
108
for/endfor Executes commands for each item in a set of items
goto Makes batch file execution jump to another location
if/endif Executes commands in specified conditions
pause Prints a message and suspends for keyboard input
stall Stalls the processor for some microseconds
Creating EFI Scripts
The Extended Firmware Interface (EFI) scripting language allows you to place a set of
EFI commands in a shell script and execute them. Once you have created this shell
script, you can use it as often as needed. You can even modify the script to make it
perform different tasks. A file with the name startup.nsh is automatically executed
when you enter the EFI shell environment. You can edit this startup.nsh file to
perform EFI tasks that you want execute automatically. Note that all EFI shell scripts
end with a “.nsh” suffix.
This section is not intended to tell you every thing there is to know about writing EFI
shell scripts. Here is what this section does provide:
Writing an EFI shell script.
EFI shell script commands and control structures.
Writing an EFI Shell Script
This section explains how to write an EFI shell script using the shell’s editor. To create a
simple shell script, follow these steps:
1. Select the drive on which you are going create the script. For example type the
following at the shell prompt and press Enter:
Shell> fs0:
2. Enter the shell’s editor. To do this, type the following at the shell prompt and press
Enter:
fs0:\> edit <filename.nsh>
where filename.nsh is the name of your shell script file. For details on edit, type
help followed by the edit command at the EFI shell prompt and press Enter.
3. Turn echo off by executing this command and pressing Enter:
fs0:\> echo -off
4. Enter the following text in your file using the edit editor:
echo This is a test file.
Save this file as mytest.nsh and exit the editor.
5. Execute the shell script by typing the file name at the shell prompt and pressing
Enter.