logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

alias.1p (6214B)


  1. '\" et
  2. .TH ALIAS "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. alias
  12. \(em define or display aliases
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. alias \fB[\fIalias-name\fB[\fR=\fIstring\fB]\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR alias
  21. utility shall create or redefine alias definitions or write the values
  22. of existing alias definitions to standard output. An alias definition
  23. provides a string value that shall replace a command name when it is
  24. encountered; see
  25. .IR "Section 2.3.1" ", " "Alias Substitution".
  26. .P
  27. An alias definition shall affect the current shell execution
  28. environment and the execution environments of the subshells of the
  29. current shell. When used as specified by this volume of POSIX.1\(hy2017, the alias definition
  30. shall not affect the parent process of the current shell nor any
  31. utility environment invoked by the shell; see
  32. .IR "Section 2.12" ", " "Shell Execution Environment".
  33. .SH OPTIONS
  34. None.
  35. .SH OPERANDS
  36. The following operands shall be supported:
  37. .IP "\fIalias-name\fR" 10
  38. Write the alias definition to standard output.
  39. .IP "\fIalias-name\fP=\fIstring\fR" 10
  40. .br
  41. Assign the value of
  42. .IR string
  43. to the alias
  44. .IR alias-name .
  45. .P
  46. If no operands are given, all alias definitions shall be written to
  47. standard output.
  48. .SH STDIN
  49. Not used.
  50. .SH "INPUT FILES"
  51. None.
  52. .SH "ENVIRONMENT VARIABLES"
  53. The following environment variables shall affect the execution of
  54. .IR alias :
  55. .IP "\fILANG\fP" 10
  56. Provide a default value for the internationalization variables that are
  57. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  58. .IR "Section 8.2" ", " "Internationalization Variables"
  59. for the precedence of internationalization variables used to determine
  60. the values of locale categories.)
  61. .IP "\fILC_ALL\fP" 10
  62. If set to a non-empty string value, override the values of all the
  63. other internationalization variables.
  64. .IP "\fILC_CTYPE\fP" 10
  65. Determine the locale for the interpretation of sequences of bytes of
  66. text data as characters (for example, single-byte as opposed to
  67. multi-byte characters in arguments).
  68. .IP "\fILC_MESSAGES\fP" 10
  69. .br
  70. Determine the locale that should be used to affect the format and
  71. contents of diagnostic messages written to standard error.
  72. .IP "\fINLSPATH\fP" 10
  73. Determine the location of message catalogs for the processing of
  74. .IR LC_MESSAGES .
  75. .SH "ASYNCHRONOUS EVENTS"
  76. Default.
  77. .SH STDOUT
  78. The format for displaying aliases (when no operands or only
  79. .IR name
  80. operands are specified) shall be:
  81. .sp
  82. .RS 4
  83. .nf
  84. "%s=%s\en", \fIname\fR, \fIvalue\fR
  85. .fi
  86. .P
  87. .RE
  88. .P
  89. The
  90. .IR value
  91. string shall be written with appropriate quoting so that it is suitable
  92. for reinput to the shell. See the description of shell quoting in
  93. .IR "Section 2.2" ", " "Quoting".
  94. .SH STDERR
  95. The standard error shall be used only for diagnostic messages.
  96. .SH "OUTPUT FILES"
  97. None.
  98. .SH "EXTENDED DESCRIPTION"
  99. None.
  100. .SH "EXIT STATUS"
  101. The following exit values shall be returned:
  102. .IP "\00" 6
  103. Successful completion.
  104. .IP >0 6
  105. One of the
  106. .IR name
  107. operands specified did not have an alias definition, or an error
  108. occurred.
  109. .SH "CONSEQUENCES OF ERRORS"
  110. Default.
  111. .LP
  112. .IR "The following sections are informative."
  113. .SH "APPLICATION USAGE"
  114. None.
  115. .SH EXAMPLES
  116. .IP " 1." 4
  117. Create a short alias for a commonly used
  118. .IR ls
  119. command:
  120. .RS 4
  121. .sp
  122. .RS 4
  123. .nf
  124. alias lf="ls -CF"
  125. .fi
  126. .P
  127. .RE
  128. .RE
  129. .IP " 2." 4
  130. Create a simple ``redo'' command to repeat previous entries in the
  131. command history file:
  132. .RS 4
  133. .sp
  134. .RS 4
  135. .nf
  136. alias r=\(aqfc -s\(aq
  137. .fi
  138. .P
  139. .RE
  140. .RE
  141. .IP " 3." 4
  142. Use 1K units for
  143. .IR du :
  144. .RS 4
  145. .sp
  146. .RS 4
  147. .nf
  148. alias du=du\e -k
  149. .fi
  150. .P
  151. .RE
  152. .RE
  153. .IP " 4." 4
  154. Set up
  155. .IR nohup
  156. so that it can deal with an argument that is itself an alias name:
  157. .RS 4
  158. .sp
  159. .RS 4
  160. .nf
  161. alias nohup="nohup "
  162. .fi
  163. .P
  164. .RE
  165. .RE
  166. .SH RATIONALE
  167. The
  168. .IR alias
  169. description is based on historical KornShell implementations. Known
  170. differences exist between that and the C shell. The KornShell version
  171. was adopted to be consistent with all the other KornShell features in
  172. \&this volume of POSIX.1\(hy2017, such as command line editing.
  173. .P
  174. Since
  175. .IR alias
  176. affects the current shell execution environment, it is generally
  177. provided as a shell regular built-in.
  178. .P
  179. Historical versions of the KornShell have allowed aliases to be
  180. exported to scripts that are invoked by the same shell. This is
  181. triggered by the
  182. .IR alias
  183. .BR \-x
  184. flag; it is allowed by this volume of POSIX.1\(hy2017 only when an explicit extension such as
  185. .BR \-x
  186. is used. The standard developers considered that aliases were of use
  187. primarily to interactive users and that they should normally not affect
  188. shell scripts called by those users; functions are available to such
  189. scripts.
  190. .P
  191. Historical versions of the KornShell had not written aliases in a
  192. quoted manner suitable for reentry to the shell, but this volume of POSIX.1\(hy2017 has made
  193. this a requirement for all similar output. Therefore, consistency was
  194. chosen over this detail of historical practice.
  195. .SH "FUTURE DIRECTIONS"
  196. None.
  197. .SH "SEE ALSO"
  198. .IR "Section 2.9.5" ", " "Function Definition Command"
  199. .P
  200. The Base Definitions volume of POSIX.1\(hy2017,
  201. .IR "Chapter 8" ", " "Environment Variables"
  202. .\"
  203. .SH COPYRIGHT
  204. Portions of this text are reprinted and reproduced in electronic form
  205. from IEEE Std 1003.1-2017, Standard for Information Technology
  206. -- Portable Operating System Interface (POSIX), The Open Group Base
  207. Specifications Issue 7, 2018 Edition,
  208. Copyright (C) 2018 by the Institute of
  209. Electrical and Electronics Engineers, Inc and The Open Group.
  210. In the event of any discrepancy between this version and the original IEEE and
  211. The Open Group Standard, the original IEEE and The Open Group Standard
  212. is the referee document. The original Standard can be obtained online at
  213. http://www.opengroup.org/unix/online.html .
  214. .PP
  215. Any typographical or formatting errors that appear
  216. in this page are most likely
  217. to have been introduced during the conversion of the source files to
  218. man page format. To report such errors, see
  219. https://www.kernel.org/doc/man-pages/reporting_bugs.html .