User`s guide
5-12
User’s Guide
EFI Shell Command Syntax
The EFI Shell implements a programming language that provides control over the execution
of individual commands. When the Shell scans its input, it always treats certain characters
specially: (#, >, %, *, ?, [, ^, space, and newline).
When a command contains a defined alias, the Shell replaces the alias with its definition
(see alias command in this chapter). If the argument is prefixed with the ^ character,
however, the argument is treated as a literal argument and alias processing is not
performed.
Note:
In interactive execution, the Shell performs variable substitution, then expands wildcards
before the command is executed.
In batch script execution, the Shell performs argument substitution, then variable
substitution, then expands wildcards before the command is executed.
Variable Substitution
Environment variables can be set and viewed through the use of the set command (see
set command in this chapter). To access the value of an environment variable as an
argument to a Shell command, delimit the name of the variable with the % character before
and after the variable name; for example, %myvariable%.
The Shell maintains a special variable, named lasterror. The variable contains the return
code of the most recently executed Shell command.
Wildcard Expansion
The *, ? and [ characters can be used as wildcard characters in filename arguments to
Shell commands.
If an argument contains one or more of these characters, the Shell processes the argument
for file meta–arguments and expands the argument list to include all filenames matching
the pattern.
These characters are part of patterns which represent file and directory names.
Character Sequence Meaning
”*”
Matches zero or more characters in a file name
”?” Matches exactly one character of a file name
”[chars]” Defines a set of characters; the pattern matches any single character in
the set. Characters in the set are not separated. Ranges of characters
can be specified by specifying the first character in a range, then the
–
character, then the last character in the range. Example: [a–zA–Z]
Table 28. Wildcard character expansion