|GNU Bash Reference Manual|
by Chet Ramey and Brian Fox
Paperback (6"x9"), 180 pages
RRP £19.95 ($29.95)
"An essential resource .... the most detailed coverage available for all aspects of Bash" --- Linux User and Developer Magazine (Issue 37, Mar 2004) Get a printed copy>>>
7.2 Job Control Builtins
bg [jobspec ...]Resume each suspended job jobspec in the background, as if it had been started with ‘&’. If jobspec is not supplied, the current job is used. The return status is zero unless it is run when job control is not enabled, or, when run with job control enabled, any jobspec was not found or specifies a job that was started without job control.
fg [jobspec]Resume the job jobspec in the foreground and make it the current job. If jobspec is not supplied, the current job is used. The return status is that of the command placed into the foreground, or non-zero if run when job control is disabled or, when run with job control enabled, jobspec does not specify a valid job or jobspec specifies a job that was started without job control.
jobs [-lnprs] [jobspec] jobs -x command [arguments]The first form lists the active jobs. The options have the following meanings:
- List process IDs in addition to the normal information.
- Display information only about jobs that have changed status since the user was last notified of their status.
- List only the process ID of the job's process group leader.
- Restrict output to running jobs.
- Restrict output to stopped jobs.
-xoption is supplied,
jobsreplaces any jobspec found in command or arguments with the corresponding process group ID, and executes command, passing it arguments, returning its exit status.
kill [-s sigspec] [-n signum] [-sigspec] jobspec or pid kill -l [exit_status]Send a signal specified by sigspec or signum to the process named by job specification jobspec or process ID pid. sigspec is either a case-insensitive signal name such as
SIGINT(with or without the
SIGprefix) or a signal number; signum is a signal number. If sigspec and signum are not present,
SIGTERMis used. The
-loption lists the signal names. If any arguments are supplied when
-lis given, the names of the signals corresponding to the arguments are listed, and the return status is zero. exit_status is a number specifying a signal number or the exit status of a process terminated by a signal. The return status is zero if at least one signal was successfully sent, or non-zero if an error occurs or an invalid option is encountered.
wait [jobspec or pid ...]Wait until the child process specified by each process ID pid or job specification jobspec exits and return the exit status of the last command waited for. If a job spec is given, all processes in the job are waited for. If no arguments are given, all currently active child processes are waited for, and the return status is zero. If neither jobspec nor pid specifies an active child process of the shell, the return status is 127.
disown [-ar] [-h] [jobspec ...]Without options, each jobspec is removed from the table of active jobs. If the
-hoption is given, the job is not removed from the table, but is marked so that
SIGHUPis not sent to the job if the shell receives a
SIGHUP. If jobspec is not present, and neither the
-roption is supplied, the current job is used. If no jobspec is supplied, the
-aoption means to remove or mark all jobs; the
-roption without a jobspec argument restricts operation to running jobs.
suspend [-f]Suspend the execution of this shell until it receives a
-foption means to suspend even if the shell is a login shell.
When job control is not active, the
builtins do not accept jobspec arguments. They must be
supplied process IDs.
|ISBN 0954161777||GNU Bash Reference Manual||See the print edition|