display status of jobs
jobs [ -l | -p ]
[ job_ID ... ]
jobs displays the status of jobs that were started in the
current shell. If a list of job IDs is specified,
jobs will only report on these.
A job_ID may be specified in any of the following forms:
jobs accepts either of the following options:
Specifies the process ID of the process group leader of a
job (found using the -p option).
Specifies a job by a decimal number n, its identification
number in the current shell.
Specify the current job.
Specifies the job that would become the current job if the present
one were to exit.
Specifies the job whose command begins with string.
Specifies the job whose command contains string.
By default, jobs reports the status of all stopped jobs,
all running background jobs, and all jobs where a status change has
not been reported to the shell.
Prints a long status listing for each job as shown in the ``Output
Displays only the process IDs for the process group
leaders of the specified jobs.
Output from jobs has the form:
] current status command
Output for the -l option has the form:
] current group_ID status command
Output for the -p option has the form:
The output fields have the following meanings:
The identification number of the job in the current shell.
The process IDs of the process group leaders for each job.
May be set to one of the following:
Indicates the job that would be considered the current
job by the
commands; select this job by specifying %% or
Indicates the job that would become the current default job if the
present one were to exit; specify this job using %-.
All jobs other than the current and next to current jobs.
The process ID of the process group leader; subsequent
lines display processes in the same process group showing only their
process ID and command.
A string that shows the state of the process:
The job completed with an exit value of 0.
The job completed normally with an exit value of code (a
The job has not exited or been suspended by a signal.
The job was suspended by the SIGTSTP signal.
The job was suspended by the SIGSTOP signal.
The job was suspended by the SIGTTIN signal.
The job was suspended by the SIGTTOU signal.
The command that was given to the shell.
Assign the process group leader's process ID for the
current default job to the variable PGLPID:
PGLPID=$(jobs -p %%)
Assign the PID of the command that contains the string
PGLPID=$(jobs -p %?"foobar")
jobs is available in
You must have enabled job control (using set -m) to use
jobs must be executed within the current shell to report
the jobs controlled by that shell.
jobs is conformant with:
ISO/IEC DIS 99452:1992, Information technology Portable Operating System Interface (POSIX) Part 2: Shell and Utilities (IEEE Std 1003.21992);
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005