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

readonly.1p (4603B)


  1. '\" et
  2. .TH READONLY "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. readonly
  12. \(em set the readonly attribute for variables
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. readonly name\fB[\fR=\fIword\fB]\fR...
  17. .P
  18. readonly\fR -p
  19. .fi
  20. .SH DESCRIPTION
  21. The variables whose
  22. .IR name s
  23. are specified shall be given the
  24. .IR readonly
  25. attribute. The values of variables with the
  26. .IR readonly
  27. attribute cannot be changed by subsequent assignment, nor can those
  28. variables be unset by the
  29. .IR unset
  30. utility. If the name of a variable is followed by =\c
  31. .IR word ,
  32. then the value of that variable shall be set to
  33. .IR word .
  34. .P
  35. The
  36. .IR readonly
  37. special built-in shall support the Base Definitions volume of POSIX.1\(hy2017,
  38. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  39. .P
  40. When
  41. .BR \-p
  42. is specified,
  43. .IR readonly
  44. writes to the standard output the names and values of all read-only
  45. variables, in the following format:
  46. .sp
  47. .RS 4
  48. .nf
  49. "readonly %s=%s\en", <\fIname\fR>, <\fIvalue\fR>
  50. .fi
  51. .P
  52. .RE
  53. .P
  54. if
  55. .IR name
  56. is set, and
  57. .sp
  58. .RS 4
  59. .nf
  60. "readonly %s\en", <\fIname\fR>
  61. .fi
  62. .P
  63. .RE
  64. .P
  65. if
  66. .IR name
  67. is unset.
  68. .P
  69. The shell shall format the output, including the proper use of quoting,
  70. so that it is suitable for reinput to the shell as commands that
  71. achieve the same value and
  72. .IR readonly
  73. attribute-setting results in a shell execution environment in which:
  74. .IP " 1." 4
  75. Variables with values at the time they were output do not have the
  76. .IR readonly
  77. attribute set.
  78. .IP " 2." 4
  79. Variables that were unset at the time they were output do not have a
  80. value at the time at which the saved output is reinput to the shell.
  81. .P
  82. When no arguments are given, the results are unspecified.
  83. .SH OPTIONS
  84. See the DESCRIPTION.
  85. .SH OPERANDS
  86. See the DESCRIPTION.
  87. .SH STDIN
  88. Not used.
  89. .SH "INPUT FILES"
  90. None.
  91. .SH "ENVIRONMENT VARIABLES"
  92. None.
  93. .SH "ASYNCHRONOUS EVENTS"
  94. Default.
  95. .SH STDOUT
  96. See the DESCRIPTION.
  97. .SH STDERR
  98. The standard error shall be used only for diagnostic messages.
  99. .SH "OUTPUT FILES"
  100. None.
  101. .SH "EXTENDED DESCRIPTION"
  102. None.
  103. .SH "EXIT STATUS"
  104. .IP "\00" 6
  105. All
  106. .IR name
  107. operands were successfully marked readonly.
  108. .IP >0 6
  109. At least one
  110. .IR name
  111. could not be marked readonly, or the
  112. .BR \-p
  113. option was specified and an error occurred.
  114. .SH "CONSEQUENCES OF ERRORS"
  115. Default.
  116. .LP
  117. .IR "The following sections are informative."
  118. .SH "APPLICATION USAGE"
  119. None.
  120. .SH EXAMPLES
  121. .LP
  122. .nf
  123. readonly HOME PWD
  124. .fi
  125. .SH "RATIONALE"
  126. Some historical shells preserve the
  127. .IR readonly
  128. attribute across separate invocations. This volume of POSIX.1\(hy2017 allows this behavior,
  129. but does not require it.
  130. .P
  131. The
  132. .BR \-p
  133. option allows portable access to the values that can be saved and then
  134. later restored using, for example, a
  135. .IR dot
  136. script. Also see the RATIONALE for
  137. .IR "\fIexport\fR\^"
  138. for a description of the no-argument and
  139. .BR \-p
  140. output cases and a related example.
  141. .P
  142. Read-only functions were considered, but they were omitted as not being
  143. historical practice or particularly useful. Furthermore, functions must
  144. not be read-only across invocations to preclude ``spoofing''
  145. (spoofing is the term for the practice of creating a program that acts
  146. like a well-known utility with the intent of subverting the real intent
  147. of the user) of administrative or security-relevant (or
  148. security-conscious) shell scripts.
  149. .SH "FUTURE DIRECTIONS"
  150. None.
  151. .SH "SEE ALSO"
  152. .IR "Section 2.14" ", " "Special Built-In Utilities"
  153. .P
  154. The Base Definitions volume of POSIX.1\(hy2017,
  155. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  156. .\"
  157. .SH COPYRIGHT
  158. Portions of this text are reprinted and reproduced in electronic form
  159. from IEEE Std 1003.1-2017, Standard for Information Technology
  160. -- Portable Operating System Interface (POSIX), The Open Group Base
  161. Specifications Issue 7, 2018 Edition,
  162. Copyright (C) 2018 by the Institute of
  163. Electrical and Electronics Engineers, Inc and The Open Group.
  164. In the event of any discrepancy between this version and the original IEEE and
  165. The Open Group Standard, the original IEEE and The Open Group Standard
  166. is the referee document. The original Standard can be obtained online at
  167. http://www.opengroup.org/unix/online.html .
  168. .PP
  169. Any typographical or formatting errors that appear
  170. in this page are most likely
  171. to have been introduced during the conversion of the source files to
  172. man page format. To report such errors, see
  173. https://www.kernel.org/doc/man-pages/reporting_bugs.html .