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

hash.1p (5644B)


  1. '\" et
  2. .TH HASH "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. hash
  12. \(em remember or report utility locations
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. hash \fB[\fIutility\fR...\fB]\fR
  17. .P
  18. hash -r
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. .IR hash
  23. utility shall affect the way the current shell environment remembers
  24. the locations of utilities found as described in
  25. .IR "Section 2.9.1.1" ", " "Command Search and Execution".
  26. Depending on the arguments specified, it shall add utility locations to
  27. its list of remembered locations or it shall purge the contents of the
  28. list. When no arguments are specified, it shall report on the contents
  29. of the list.
  30. .P
  31. Utilities provided as built-ins to the shell shall not be reported by
  32. .IR hash .
  33. .SH OPTIONS
  34. The
  35. .IR hash
  36. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  37. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  38. .P
  39. The following option shall be supported:
  40. .IP "\fB\-r\fP" 10
  41. Forget all previously remembered utility locations.
  42. .SH OPERANDS
  43. The following operand shall be supported:
  44. .IP "\fIutility\fR" 10
  45. The name of a utility to be searched for and added to the list of
  46. remembered locations. If
  47. .IR utility
  48. contains one or more
  49. <slash>
  50. characters, the results are unspecified.
  51. .SH STDIN
  52. Not used.
  53. .SH "INPUT FILES"
  54. None.
  55. .SH "ENVIRONMENT VARIABLES"
  56. The following environment variables shall affect the execution of
  57. .IR hash :
  58. .IP "\fILANG\fP" 10
  59. Provide a default value for the internationalization variables that are
  60. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  61. .IR "Section 8.2" ", " "Internationalization Variables"
  62. for the precedence of internationalization variables used to determine
  63. the values of locale categories.)
  64. .IP "\fILC_ALL\fP" 10
  65. If set to a non-empty string value, override the values of all the
  66. other internationalization variables.
  67. .IP "\fILC_CTYPE\fP" 10
  68. Determine the locale for the interpretation of sequences of bytes of
  69. text data as characters (for example, single-byte as opposed to
  70. multi-byte characters in arguments).
  71. .IP "\fILC_MESSAGES\fP" 10
  72. .br
  73. Determine the locale that should be used to affect the format and
  74. contents of diagnostic messages written to standard error.
  75. .IP "\fINLSPATH\fP" 10
  76. Determine the location of message catalogs for the processing of
  77. .IR LC_MESSAGES .
  78. .IP "\fIPATH\fP" 10
  79. Determine the location of
  80. .IR utility ,
  81. as described in the Base Definitions volume of POSIX.1\(hy2017,
  82. .IR "Chapter 8" ", " "Environment Variables".
  83. .SH "ASYNCHRONOUS EVENTS"
  84. Default.
  85. .SH STDOUT
  86. The standard output of
  87. .IR hash
  88. shall be used when no arguments are specified. Its format is
  89. unspecified, but includes the pathname of each utility in the list of
  90. remembered locations for the current shell environment. This list
  91. shall consist of those utilities named in previous
  92. .IR hash
  93. invocations that have been invoked, and may contain those invoked and
  94. found through the normal command search process.
  95. .SH STDERR
  96. The standard error shall be used only for diagnostic messages.
  97. .SH "OUTPUT FILES"
  98. None.
  99. .SH "EXTENDED DESCRIPTION"
  100. None.
  101. .SH "EXIT STATUS"
  102. The following exit values shall be returned:
  103. .IP "\00" 6
  104. Successful completion.
  105. .IP >0 6
  106. An error occurred.
  107. .SH "CONSEQUENCES OF ERRORS"
  108. Default.
  109. .LP
  110. .IR "The following sections are informative."
  111. .SH "APPLICATION USAGE"
  112. Since
  113. .IR hash
  114. affects the current shell execution environment, it is always provided
  115. as a shell regular built-in. If it is called in a separate utility
  116. execution environment, such as one of the following:
  117. .sp
  118. .RS 4
  119. .nf
  120. nohup hash -r
  121. find . -type f | xargs hash
  122. .fi
  123. .P
  124. .RE
  125. .P
  126. it does not affect the command search process of the caller's
  127. environment.
  128. .P
  129. The
  130. .IR hash
  131. utility may be implemented as an alias\(emfor example,
  132. .IR alias
  133. .BR "\-t\ \-" ,
  134. in which case utilities found through normal command search are not
  135. listed by the
  136. .IR hash
  137. command.
  138. .P
  139. The effects of
  140. .IR hash
  141. .BR \-r
  142. can also be achieved portably by resetting the value of
  143. .IR PATH ;
  144. in the simplest form, this can be:
  145. .sp
  146. .RS 4
  147. .nf
  148. PATH="$PATH"
  149. .fi
  150. .P
  151. .RE
  152. .P
  153. The use of
  154. .IR hash
  155. with
  156. .IR utility
  157. names is unnecessary for most applications, but may provide a
  158. performance improvement on a few implementations; normally, the hashing
  159. process is included by default.
  160. .SH EXAMPLES
  161. None.
  162. .SH RATIONALE
  163. None.
  164. .SH "FUTURE DIRECTIONS"
  165. None.
  166. .SH "SEE ALSO"
  167. .IR "Section 2.9.1.1" ", " "Command Search and Execution"
  168. .P
  169. The Base Definitions volume of POSIX.1\(hy2017,
  170. .IR "Chapter 8" ", " "Environment Variables",
  171. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  172. .\"
  173. .SH COPYRIGHT
  174. Portions of this text are reprinted and reproduced in electronic form
  175. from IEEE Std 1003.1-2017, Standard for Information Technology
  176. -- Portable Operating System Interface (POSIX), The Open Group Base
  177. Specifications Issue 7, 2018 Edition,
  178. Copyright (C) 2018 by the Institute of
  179. Electrical and Electronics Engineers, Inc and The Open Group.
  180. In the event of any discrepancy between this version and the original IEEE and
  181. The Open Group Standard, the original IEEE and The Open Group Standard
  182. is the referee document. The original Standard can be obtained online at
  183. http://www.opengroup.org/unix/online.html .
  184. .PP
  185. Any typographical or formatting errors that appear
  186. in this page are most likely
  187. to have been introduced during the conversion of the source files to
  188. man page format. To report such errors, see
  189. https://www.kernel.org/doc/man-pages/reporting_bugs.html .