GNU Info

Info Node: (bashref.info)Job Control Builtins

(bashref.info)Job Control Builtins


Next: Job Control Variables Prev: Job Control Basics Up: Job Control
Enter node , (file) or (file)node

Job Control Builtins
====================

`bg'
          bg [JOBSPEC]
     Resume the 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, if
     JOBSPEC was not found or JOBSPEC specifies a job that was started
     without job control.

`fg'
          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'
          jobs [-lnprs] [JOBSPEC]
          jobs -x COMMAND [ARGUMENTS]

     The first form lists the active jobs.  The options have the
     following meanings:

    `-l'
          List process IDs in addition to the normal information.

    `-n'
          Display information only about jobs that have changed status
          since the user was last notified of their status.

    `-p'
          List only the process ID of the job's process group leader.

    `-r'
          Restrict output to running jobs.

    `-s'
          Restrict output to stopped jobs.

     If JOBSPEC is given, output is restricted to information about
     that job.  If JOBSPEC is not supplied, the status of all jobs is
     listed.

     If the `-x' option is supplied, `jobs' replaces any JOBSPEC found
     in COMMAND or ARGUMENTS with the corresponding process group ID,
     and executes COMMAND, passing it ARGUMENTs, returning its exit
     status.

`kill'
          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 signal name such as `SIGINT' (with or without the `SIG' prefix)
     or a signal number; SIGNUM is a signal number.  If SIGSPEC and
     SIGNUM are not present, `SIGTERM' is used.  The `-l' option lists
     the signal names.  If any arguments are supplied when `-l' is
     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'
          wait [JOBSPEC or PID]
     Wait until the child process specified by 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'
          disown [-ar] [-h] [JOBSPEC ...]
     Without options, each JOBSPEC is removed from the table of active
     jobs.  If the `-h' option is given, the job is not removed from
     the table, but is marked so that `SIGHUP' is not sent to the job
     if the shell receives a `SIGHUP'.  If JOBSPEC is not present, and
     neither the `-a' nor `-r' option is supplied, the current job is
     used.  If no JOBSPEC is supplied, the `-a' option means to remove
     or mark all jobs; the `-r' option without a JOBSPEC argument
     restricts operation to running jobs.

`suspend'
          suspend [-f]
     Suspend the execution of this shell until it receives a `SIGCONT'
     signal.  The `-f' option means to suspend even if the shell is a
     login shell.

   When job control is not active, the `kill' and `wait' builtins do
not accept JOBSPEC arguments.  They must be supplied process IDs.


automatically generated by info2www version 1.2.2.9