*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> bg (1)              
Title
Content
Arch
Section
 

Contents


bg(1)									 bg(1)


NAME    [Toc]    [Back]

     bg	- run jobs in the background

SYNOPSIS    [Toc]    [Back]

     bg	[job_id	...]

DESCRIPTION    [Toc]    [Back]

     If	job control is enabled (see the	description of set -m in the sh(1)
     manpage), the bg utility resumes suspended	jobs from the current
     environment by running them as background jobs. If	the job	specified by
     job_id is already a running background job, the bg	utility	has no effect
     and will exit successfully.

     Using bg to place a job into the background causes	its process ID to
     become "known in the current shell	execution environment",	as if it had
     been started as an	asynchronous list.

OPERANDS    [Toc]    [Back]

     The following operand is supported:

     job_id    Specify the job to be resumed as	a background job. If no	job_id
	       operand is given, the most recently suspended job is used. The
	       format of job_id	is described in	the entry for job control job
	       ID in the (sh) manpage.

STDOUT    [Toc]    [Back]

     The output	of bg consists of a line in the	format:

	  "[%d]	%s\n", <job-number>, <command>

     where the fields are as follows:

     <job-number>      A number	that can be used to identify the job to	the
		       wait, fg	and kill utilities. Using these	utilities, the
		       job can be identified by	prefixing the job number with
		       "%".

     <command>	       The associated command that was given to	the shell.

EXIT STATUS    [Toc]    [Back]

     The following exit	values are returned:

     0	 Successful completion.

     >0	 An error occurred.

CONSEQUENCES OF	ERRORS
     If	job control is disabled, the bg	utility	will exit with an error	and no
     job will be placed	in the background.






									Page 1






bg(1)									 bg(1)


APPLICATION USAGE    [Toc]    [Back]

     A job is generally	suspended by typing the	SUSP character (<control>Z).
     At	that point, bg can put the job into the	background. This is most
     effective when the	job is expecting no terminal input and its output has
     been redirected to	non-terminal files. A background job can be forced to
     stop when it has terminal output by issuing the command:

	  stty tostop

     A background job can be stopped with the command:

	  kill -s stop job ID

     The bg utility will not work as expected when it is operating in its own
     utility execution environment because that	environment will have no
     suspended jobs. In	the following examples:

	   ... | xargs bg

	  (bg)

     each bg operates in a different environment and will not share its	parent
     shell's understanding of jobs. For	this reason, bg	is generally
     implemented as a shell regular built-in.

SEE ALSO    [Toc]    [Back]

      
      
     fg(1), kill(1), jobs(1), sh(1), wait(1).


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
bg Tru64 Runs jobs in the background
fg IRIX run jobs in the foreground
atd Linux run jobs queued for later execution
atrun Linux run jobs queued for later execution
atrm OpenBSD remove jobs spooled by at(1)
fg Tru64 Runs jobs in the foreground
atrun FreeBSD run jobs queued for later execution
atrm Tru64 Removes jobs spooled by at
at.allow Linux determine who can submit jobs via at or batch
atq Tru64 Prints the queue of jobs waiting to be run
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service