5.1.5 Command alias definitions
In JP1/Advanced Shell, you can define an alias for a command. You use the alias command for the alias definition. The following shows the format:
- Format:
alias alias-name=value
If you specify for value a character string that contains a space, you must enclose the entire value in quotation marks.
You can specify for alias-name a built-in command to redefine the command, but no reserved word can be redefined as an alias. The following shows an example.
- Redefining a built-in command:
alias read="read STR" # Define "read STR" for the alias name read uname | read # read is executed as "read STR" echo $STR # The result of uname set in the STR variable is output
- Specifying a reserved word as an alias:
alias while="echo JP1/AS" # Define an alias for the reserved word while while # while is interpreted as a reserved word and # the while statement is terminated with a format error
You use the alias command to define aliases or to output a list of aliases. To invalidate a defined alias definition, you use the unalias command. For details about these commands, see alias command (defines aliases) and unalias command (removes alias definitions) in 9. Job Definition Script Commands and Control Statements.
In JP1/Advanced Shell, the following aliases are defined:
Alias |
Definition |
---|---|
autoload |
typeset -fu |
functions |
typeset -f |
integer |
typeset -i |
local |
typeset |
type |
whence -v |