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

return.1p (3189B)


  1. '\" et
  2. .TH RETURN "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. return
  12. \(em return from a function or dot script
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. return \fB[\fIn\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR return
  21. utility shall cause the shell to stop executing the current function or
  22. .IR dot
  23. script. If the shell is not currently executing a function or
  24. .IR dot
  25. script, the results are unspecified.
  26. .SH OPTIONS
  27. None.
  28. .SH OPERANDS
  29. See the DESCRIPTION.
  30. .SH STDIN
  31. Not used.
  32. .SH "INPUT FILES"
  33. None.
  34. .SH "ENVIRONMENT VARIABLES"
  35. None.
  36. .SH "ASYNCHRONOUS EVENTS"
  37. Default.
  38. .SH STDOUT
  39. Not used.
  40. .SH STDERR
  41. The standard error shall be used only for diagnostic messages.
  42. .SH "OUTPUT FILES"
  43. None.
  44. .SH "EXTENDED DESCRIPTION"
  45. None.
  46. .SH "EXIT STATUS"
  47. The value of the special parameter
  48. .BR '?'
  49. shall be set to
  50. .IR n ,
  51. an unsigned decimal integer, or to the exit status of the last command
  52. executed if
  53. .IR n
  54. is not specified. If
  55. .IR n
  56. is not an unsigned decimal integer, or is greater than 255, the
  57. results are unspecified. When
  58. .IR return
  59. is executed in a
  60. .IR trap
  61. action, the last command is considered to be the command that
  62. executed immediately preceding the
  63. .IR trap
  64. action.
  65. .SH "CONSEQUENCES OF ERRORS"
  66. Default.
  67. .LP
  68. .IR "The following sections are informative."
  69. .SH "APPLICATION USAGE"
  70. None.
  71. .SH "EXAMPLES"
  72. None.
  73. .SH "RATIONALE"
  74. The behavior of
  75. .IR return
  76. when not in a function or
  77. .IR dot
  78. script differs between the System V shell and the KornShell. In the
  79. System V shell this is an error, whereas in the KornShell, the effect
  80. is the same as
  81. .IR exit .
  82. .P
  83. The results of returning a number greater than 255 are undefined
  84. because of differing practices in the various historical
  85. implementations. Some shells AND out all but the low-order 8 bits;
  86. others allow larger values, but not of unlimited size.
  87. .P
  88. See the discussion of appropriate exit status values under
  89. .IR "\fIexit\fR\^".
  90. .SH "FUTURE DIRECTIONS"
  91. None.
  92. .SH "SEE ALSO"
  93. .IR "Section 2.9.5" ", " "Function Definition Command",
  94. .IR "Section 2.14" ", " "Special Built-In Utilities",
  95. .IR "\fIdot\fR\^"
  96. .\"
  97. .SH COPYRIGHT
  98. Portions of this text are reprinted and reproduced in electronic form
  99. from IEEE Std 1003.1-2017, Standard for Information Technology
  100. -- Portable Operating System Interface (POSIX), The Open Group Base
  101. Specifications Issue 7, 2018 Edition,
  102. Copyright (C) 2018 by the Institute of
  103. Electrical and Electronics Engineers, Inc and The Open Group.
  104. In the event of any discrepancy between this version and the original IEEE and
  105. The Open Group Standard, the original IEEE and The Open Group Standard
  106. is the referee document. The original Standard can be obtained online at
  107. http://www.opengroup.org/unix/online.html .
  108. .PP
  109. Any typographical or formatting errors that appear
  110. in this page are most likely
  111. to have been introduced during the conversion of the source files to
  112. man page format. To report such errors, see
  113. https://www.kernel.org/doc/man-pages/reporting_bugs.html .