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

unset.1p (4052B)


  1. '\" et
  2. .TH UNSET "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. unset
  12. \(em unset values and attributes of variables and functions
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. unset \fB[\fR-fv\fB] \fIname\fR...
  17. .fi
  18. .SH DESCRIPTION
  19. Each variable or function specified by
  20. .IR name
  21. shall be unset.
  22. .P
  23. If
  24. .BR \-v
  25. is specified,
  26. .IR name
  27. refers to a variable name and the shell shall unset it and remove it
  28. from the environment. Read-only variables cannot be unset.
  29. .P
  30. If
  31. .BR \-f
  32. is specified,
  33. .IR name
  34. refers to a function and the shell shall unset the function definition.
  35. .P
  36. If neither
  37. .BR \-f
  38. nor
  39. .BR \-v
  40. is specified,
  41. .IR name
  42. refers to a variable; if a variable by that name does not exist, it is
  43. unspecified whether a function by that name, if any, shall be unset.
  44. .P
  45. Unsetting a variable or function that was not previously set shall not
  46. be considered an error and does not cause the shell to abort.
  47. .P
  48. The
  49. .IR unset
  50. special built-in shall support the Base Definitions volume of POSIX.1\(hy2017,
  51. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  52. .P
  53. Note that:
  54. .sp
  55. .RS 4
  56. .nf
  57. VARIABLE=
  58. .fi
  59. .P
  60. .RE
  61. .P
  62. is not equivalent to an
  63. .IR unset
  64. of
  65. .BR VARIABLE ;
  66. in the example,
  67. .BR VARIABLE
  68. is set to
  69. .BR \(dq\^\(dq .
  70. Also, the variables that can be
  71. .IR unset
  72. should not be misinterpreted to include the special parameters (see
  73. .IR "Section 2.5.2" ", " "Special Parameters").
  74. .SH OPTIONS
  75. See the DESCRIPTION.
  76. .SH OPERANDS
  77. See the DESCRIPTION.
  78. .SH STDIN
  79. Not used.
  80. .SH "INPUT FILES"
  81. None.
  82. .SH "ENVIRONMENT VARIABLES"
  83. None.
  84. .SH "ASYNCHRONOUS EVENTS"
  85. Default.
  86. .SH STDOUT
  87. Not used.
  88. .SH STDERR
  89. The standard error shall be used only for diagnostic messages.
  90. .SH "OUTPUT FILES"
  91. None.
  92. .SH "EXTENDED DESCRIPTION"
  93. None.
  94. .SH "EXIT STATUS"
  95. .IP "\00" 6
  96. All
  97. .IR name
  98. operands were successfully unset.
  99. .IP >0 6
  100. At least one
  101. .IR name
  102. could not be unset.
  103. .SH "CONSEQUENCES OF ERRORS"
  104. Default.
  105. .LP
  106. .IR "The following sections are informative."
  107. .SH "APPLICATION USAGE"
  108. None.
  109. .SH EXAMPLES
  110. Unset
  111. .IR VISUAL
  112. variable:
  113. .sp
  114. .RS 4
  115. .nf
  116. unset -v VISUAL
  117. .fi
  118. .P
  119. .RE
  120. .P
  121. Unset the functions
  122. .BR foo
  123. and
  124. .BR bar :
  125. .sp
  126. .RS 4
  127. .nf
  128. unset -f foo bar
  129. .fi
  130. .P
  131. .RE
  132. .SH "RATIONALE"
  133. Consideration was given to omitting the
  134. .BR \-f
  135. option in favor of an
  136. .IR unfunction
  137. utility, but the standard developers decided to retain historical
  138. practice.
  139. .P
  140. The
  141. .BR \-v
  142. option was introduced because System V historically used one name space
  143. for both variables and functions. When
  144. .IR unset
  145. is used without options, System V historically unset either a function
  146. or a variable, and there was no confusion about which one was intended.
  147. A portable POSIX application can use
  148. .IR unset
  149. without an option to unset a variable, but not a function; the
  150. .BR \-f
  151. option must be used.
  152. .SH "FUTURE DIRECTIONS"
  153. None.
  154. .SH "SEE ALSO"
  155. .IR "Section 2.14" ", " "Special Built-In Utilities"
  156. .P
  157. The Base Definitions volume of POSIX.1\(hy2017,
  158. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  159. .\"
  160. .SH COPYRIGHT
  161. Portions of this text are reprinted and reproduced in electronic form
  162. from IEEE Std 1003.1-2017, Standard for Information Technology
  163. -- Portable Operating System Interface (POSIX), The Open Group Base
  164. Specifications Issue 7, 2018 Edition,
  165. Copyright (C) 2018 by the Institute of
  166. Electrical and Electronics Engineers, Inc and The Open Group.
  167. In the event of any discrepancy between this version and the original IEEE and
  168. The Open Group Standard, the original IEEE and The Open Group Standard
  169. is the referee document. The original Standard can be obtained online at
  170. http://www.opengroup.org/unix/online.html .
  171. .PP
  172. Any typographical or formatting errors that appear
  173. in this page are most likely
  174. to have been introduced during the conversion of the source files to
  175. man page format. To report such errors, see
  176. https://www.kernel.org/doc/man-pages/reporting_bugs.html .