9.3.3 alias command (defines aliases)
Syntax
alias [ -p|-x|+p|+x] [name [=value]...]
Description
This command defines aliases or outputs defined aliases to the standard output. If you do not specify at least one argument, it outputs the names and values of the aliases that are currently defined.
Arguments
- -p
Outputs the aliases that have been defined, in the form alias alias-name=value.
- -x|+x
Defines or outputs exported aliases.
- +p
Outputs the aliases that have been defined, in the form alias alias-name.
- name
Specifies a name for an alias to be defined or output. To output an alias, specify in name the name of an alias that has already been defined.
- value
Specifies the command to set to the alias name specified in name. To define an alias, specify value in the form alias-name=value.
Return codes
Return code |
Meaning |
---|---|
0 |
Normal termination |
1 |
Error termination
|
Notes
Even if the command syntax of this regular built-in command is invalid, it does not exit the shell that is executing the command.
Example
Output a defined alias (functions).
Contents of the job definition script:
alias functions='typeset -f' alias functions
Contents of the STDOUT file of the execution job:
******** JOB SCOPE STDOUT ******** functions='typeset -f'