Section 5.6. Job Control

5.6. Job Control

Job control lets you place foreground jobs in the background, bring background jobs to the foreground, or suspend (temporarily stop) running jobs. Job control is enabled by default. Once disabled, it can be reenabled by any of the following commands:

  bash -m -i   set -m   set -o monitor  

Many job control commands take jobID as an argument. This argument can be specified as follows :



% n

Job number n



% s

Job whose command line starts with string s



%? s

Job whose command line contains string s



%%

Current job



%+

Current job (same as preceding )



%-

Previous job

bash provides the following job control commands. For more information on these commands, see the upcoming section "Built-in Commands."



bg

Put a job in the background.



fg

Put a job in the foreground.



jobs

List active jobs.



kill

Terminate a job.



stop

Suspend a background job.



stty tostop

Stop background jobs if they try to send output to the terminal.



wait

Wait for background jobs to finish.



Ctrl-Z

Suspend a foreground job, and use bg or fg to restart it in the background or foreground. (Your terminal may use something other than Ctrl-Z as the suspend character.)



MAC OS X Tiger in a Nutshell
Mac OS X Tiger in a Nutshell: A Desktop Quick Reference (In a Nutshell (OReilly))
ISBN: 0596009437
EAN: 2147483647
Year: 2003
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net