DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

fg(1)


fg -- run jobs in the foreground

Synopsis

/u95/u95/bin/fg [job_id]

Description

This shell script executes the builtin command of the same name as implemented by the /u95/bin/sh( ) shell. See ksh(1) for more information on this shell.

If job control is enabled (see the description of set -m on the ksh(1) manual page), the fg command moves a background job from the current shell's execution environment into the foreground.

Using fg to place a job into the foreground will remove its process ID from the list of those ``known in the current shell execution environment''. See the ``Commands'' and ``Jobs'' subsections of the ksh(1) manual page for more information on asynchronous command execution and job control.

Operands


job_id
Specify the job to be run as a foreground job. If no job_id operand is given, the job_id of the job that was most recently suspended, placed in the background or run as a background job will be used. Background jobs for the current shell can be displayed using the jobs(1) or ps(1) commands.

Environment variables

The following environment variables affect the execution of bg:

LANG
Provide a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).

LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

Output

The fg command writes the command line of the job to standard output.

Exit codes

An exit code of 0 indicates successful completion; an exit code greater than 0 indicates an error.

Diagnostics

If job control is disabled, the fg command exits with an error and no job will be placed in the foreground.

Usage

The fg utility will not work as expected when it is operating in its own utility execution environment because that environment will have no applicable jobs to manipulate; see the ``Usage'' section of the bg(1) manual page.

References

bg(1), kill(1), jobs(1), ksh(1), wait(1)


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 02 June 2005