80 lines
2.0 KiB
Groff
80 lines
2.0 KiB
Groff
'\"macro stdmacro
|
|
.if n .pH g1.alias @(#)alias 30.2 of 12/25/85
|
|
.nr X
|
|
.if \nX=0 .ds x} alias 1 "Essential Utilities" "\&"
|
|
.if \nX=1 .ds x} alias 1 "Essential Utilities"
|
|
.if \nX=2 .ds x} alias 1 "" "\&"
|
|
.if \nX=3 .ds x} alias "" "" "\&"
|
|
.ds OK [\|
|
|
.ds CK \|]
|
|
.TH \*(x}
|
|
.SH NAME
|
|
\f3alias\f1 - define or display aliases
|
|
.SH SYNOPSIS
|
|
\f3alias\f1 [\f3alias_name\f1[\f3=string\f1] ...]
|
|
.SH DESCRIPTION
|
|
The \f3alias\f1 utility creates or redefines alias definitions or writes the
|
|
values of existing alias definitions to standard output. An alias
|
|
definition provides a string value that replaces a command name when it
|
|
is encountered.
|
|
|
|
An alias definition affects the current shell execution environment and
|
|
the execution environments of the subshells of the current shell. When
|
|
used as specified by this specification, the alias definition will not
|
|
affect the parent process of the current shell nor any utility
|
|
environment invoked by the shell.
|
|
.SH OPERANDS
|
|
The following operands are supported:
|
|
.TP 20
|
|
\f4alias_name\fP
|
|
Write the alias definition to standard output.
|
|
.TP 20
|
|
\f4alias_name=string\fP
|
|
Assign the value of string to the alias \f3alias_name.\f1
|
|
.PP
|
|
If no operands are given, all alias definitions will be written to
|
|
standard output.
|
|
.SH STDOUT
|
|
The format for displaying aliases (when no operands or only name
|
|
operands are specified) is:
|
|
.IP
|
|
"%s=%s\\n", name, value
|
|
.PP
|
|
The value string will be written with appropriate quoting so that it is
|
|
suitable for reinput to the shell.
|
|
.SH EXIT STATUS
|
|
The following exit values are returned:
|
|
.TP 5
|
|
\f40\fP
|
|
Successful completion.
|
|
.TP 5
|
|
\f3>0\fP
|
|
One of the name operands specified did not have an alias definition,
|
|
or an error occurred.
|
|
.SH EXAMPLES
|
|
.PP
|
|
.TP
|
|
1.
|
|
Change \f3ls\f1 to give a columnated, more annotated output:
|
|
.IP
|
|
alias ls="ls -CF"
|
|
.TP
|
|
2.
|
|
Create a simple "redo" command to repeat previous entries in the
|
|
command history file:
|
|
.IP
|
|
alias r='fc -s'
|
|
.TP
|
|
3.
|
|
Use 1K units for \f3du\f1:
|
|
.IP
|
|
alias du=du\ -k
|
|
.TP
|
|
4.
|
|
Set up \f3nohup\f1 so that it can deal with an argument that is itself an
|
|
alias name:
|
|
.IP
|
|
alias nohup="nohup "
|
|
.SH SEE ALSO
|
|
\f3sh(1)\f1
|