alias

Name

alias -- Manipulate command line aliases

Synopsis

alias { name} [ value]

Arguments

NameTypeDescriptionDefault
nameNameThe name for this alias.none
valueStringReplacement value for the alias.none

Description

The alias command is used to maintain simple command line aliases. These aliases are shorthand for longer expressions. When the pattern %{name} appears in a command line, including in a script, the corresponding value will be substituted. Aliases may be nested.

If no value is provided, then the current value of the alias is displayed.

If the system supports non-volatile configuration data via the fconfig command (see the Section called Persistent State Flash-based Configuration and Control in Chapter 2), then the value will be saved and used when the system is reset.

Examples

Set an alias.

 
RedBoot> alias joe "This is Joe"
Update RedBoot non-volatile configuration - continue (y/n)? n

Display an alias.

 
RedBoot> alias joe
'joe' = 'This is Joe'

Use an alias. Note: the "=" command simply echoes the command to to console.

 
RedBoot> = %{joe}
This is Joe

Aliases can be nested.

RedBoot> alias frank "Who are you? %{joe}"
Update RedBoot non-volatile configuration - continue (y/n)? n
RedBoot> = %{frank}
Who are you? This is Joe

Notice how the value of %{frank} changes when %{joe} is changed since the value of %{joe} is not evaluated until %{frank} is evaluated.

RedBoot> alias joe "This is now Josephine"
Update RedBoot non-volatile configuration - continue (y/n)? n
RedBoot> = %{frank}
Who are you? This is now Josephine