mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
c070a2aa3e
Rework for Doxygen >1.8. Moved large parts of the documentation to a simplified format, making use of Markdown enhancements and fixing bad long options.
34 lines
960 B
Text
34 lines
960 B
Text
\section alias alias - create a function
|
|
|
|
\subsection alias-synopsis Synopsis
|
|
\fish{syn}
|
|
alias NAME DEFINITION
|
|
alias NAME=DEFINITION
|
|
\endfish
|
|
|
|
\subsection alias-description Description
|
|
|
|
`alias` is a simple wrapper for the `function` builtin. It exists for backwards compatibility with Posix shells. For other uses, it is recommended to define a <a href='#function'>function</a>.
|
|
|
|
`fish` does not keep track of which functions have been defined using `alias`. They must be erased using `functions -e`.
|
|
|
|
- `NAME` is the name of the alias
|
|
- `DEFINITION` is the actual command to execute. The string `$argv` will be appended.
|
|
|
|
You cannot create an alias to a function with the same name.
|
|
|
|
\subsection alias-example Example
|
|
|
|
The following code will create `rmi`, which runs `rm` with additional arguments on every invocation.
|
|
|
|
\fish
|
|
alias rmi "rm -i"
|
|
\endfish
|
|
|
|
This is equivalent to entering the following function:
|
|
|
|
\fish
|
|
function rmi
|
|
rm -i $argv
|
|
end
|
|
\endfish
|