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

fg.1p (5234B)


  1. '\" et
  2. .TH FG "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. fg
  12. \(em run jobs in the foreground
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. fg \fB[\fIjob_id\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. If job control is enabled (see the description of
  20. .IR set
  21. .BR \-m ),
  22. the
  23. .IR fg
  24. utility shall move a background job from the current environment (see
  25. .IR "Section 2.12" ", " "Shell Execution Environment")
  26. into the foreground.
  27. .P
  28. Using
  29. .IR fg
  30. to place a job into the foreground shall remove its process ID from the
  31. list of those ``known in the current shell execution environment''; see
  32. .IR "Section 2.9.3.1" ", " "Examples".
  33. .SH OPTIONS
  34. None.
  35. .SH OPERANDS
  36. The following operand shall be supported:
  37. .IP "\fIjob_id\fR" 10
  38. Specify the job to be run as a foreground job. If no
  39. .IR job_id
  40. operand is given, the
  41. .IR job_id
  42. for the job that was most recently suspended, placed in the background,
  43. or run as a background job shall be used. The format of
  44. .IR job_id
  45. is described in the Base Definitions volume of POSIX.1\(hy2017,
  46. .IR "Section 3.204" ", " "Job Control Job ID".
  47. .SH STDIN
  48. Not used.
  49. .SH "INPUT FILES"
  50. None.
  51. .SH "ENVIRONMENT VARIABLES"
  52. The following environment variables shall affect the execution of
  53. .IR fg :
  54. .IP "\fILANG\fP" 10
  55. Provide a default value for the internationalization variables that are
  56. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  57. .IR "Section 8.2" ", " "Internationalization Variables"
  58. for the precedence of internationalization variables used to determine
  59. the values of locale categories.)
  60. .IP "\fILC_ALL\fP" 10
  61. If set to a non-empty string value, override the values of all the
  62. other internationalization variables.
  63. .IP "\fILC_CTYPE\fP" 10
  64. Determine the locale for the interpretation of sequences of bytes of
  65. text data as characters (for example, single-byte as opposed to
  66. multi-byte characters in arguments).
  67. .IP "\fILC_MESSAGES\fP" 10
  68. .br
  69. Determine the locale that should be used to affect the format and
  70. contents of diagnostic messages written to standard error.
  71. .IP "\fINLSPATH\fP" 10
  72. Determine the location of message catalogs for the processing of
  73. .IR LC_MESSAGES .
  74. .SH "ASYNCHRONOUS EVENTS"
  75. Default.
  76. .SH STDOUT
  77. The
  78. .IR fg
  79. utility shall write the command line of the job to standard output
  80. in the following format:
  81. .sp
  82. .RS 4
  83. .nf
  84. "%s\en", <\fIcommand\fR>
  85. .fi
  86. .P
  87. .RE
  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. The following exit values shall be returned:
  96. .IP "\00" 6
  97. Successful completion.
  98. .IP >0 6
  99. An error occurred.
  100. .SH "CONSEQUENCES OF ERRORS"
  101. If job control is disabled, the
  102. .IR fg
  103. utility shall exit with an error and no job shall be placed in the
  104. foreground.
  105. .LP
  106. .IR "The following sections are informative."
  107. .SH "APPLICATION USAGE"
  108. The
  109. .IR fg
  110. utility does not work as expected when it is operating in its own
  111. utility execution environment because that environment has no
  112. applicable jobs to manipulate. See the APPLICATION USAGE section for
  113. .IR "\fIbg\fR\^".
  114. For this reason,
  115. .IR fg
  116. is generally implemented as a shell regular built-in.
  117. .SH EXAMPLES
  118. None.
  119. .SH RATIONALE
  120. The extensions to the shell specified in this volume of POSIX.1\(hy2017 have mostly been based
  121. on features provided by the KornShell. The job control features
  122. provided by
  123. .IR bg ,
  124. .IR fg ,
  125. and
  126. .IR jobs
  127. are also based on the KornShell. The standard developers examined the
  128. characteristics of the C shell versions of these utilities and found
  129. that differences exist. Despite widespread use of the C shell, the
  130. KornShell versions were selected for this volume of POSIX.1\(hy2017 to maintain a degree of
  131. uniformity with the rest of the KornShell features selected (such as
  132. the very popular command line editing features).
  133. .SH "FUTURE DIRECTIONS"
  134. None.
  135. .SH "SEE ALSO"
  136. .IR "Section 2.9.3.1" ", " "Examples",
  137. .IR "Section 2.12" ", " "Shell Execution Environment",
  138. .IR "\fIbg\fR\^",
  139. .IR "\fIkill\fR\^",
  140. .IR "\fIjobs\fR\^",
  141. .IR "\fIwait\fR\^"
  142. .P
  143. The Base Definitions volume of POSIX.1\(hy2017,
  144. .IR "Section 3.204" ", " "Job Control Job ID",
  145. .IR "Chapter 8" ", " "Environment Variables"
  146. .\"
  147. .SH COPYRIGHT
  148. Portions of this text are reprinted and reproduced in electronic form
  149. from IEEE Std 1003.1-2017, Standard for Information Technology
  150. -- Portable Operating System Interface (POSIX), The Open Group Base
  151. Specifications Issue 7, 2018 Edition,
  152. Copyright (C) 2018 by the Institute of
  153. Electrical and Electronics Engineers, Inc and The Open Group.
  154. In the event of any discrepancy between this version and the original IEEE and
  155. The Open Group Standard, the original IEEE and The Open Group Standard
  156. is the referee document. The original Standard can be obtained online at
  157. http://www.opengroup.org/unix/online.html .
  158. .PP
  159. Any typographical or formatting errors that appear
  160. in this page are most likely
  161. to have been introduced during the conversion of the source files to
  162. man page format. To report such errors, see
  163. https://www.kernel.org/doc/man-pages/reporting_bugs.html .