Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Starting a job in the background with an ampersand (&) z/OS UNIX System Services User's Guide SA23-2279-00 |
|
To start a command as a background job, end the command line with
an ampersand (&). For example:
When the background job starts to run, the system:
The first (or only) PID is also the PGID. This is an example
of the output when you enter a background command:
3 is the job identifier and 717046 is the PID and PGID.Tip: Note the PID numbers and the job number when you create a background job; you can use them to check the status of the job or to end it. Unlike a batch job, a shell job running in the background directs its output to standard output, your workstation screen. If you do not want to have this output interfering with your work in the foreground, remember to redirect the output to a file when you start a background command. After the output is redirected, you can look at it whenever it is convenient. A background job can be suspended. A background job that attempts to read from stdin is suspended until it is made the foreground process. Therefore, if a program reads from stdin, you may want to redirect stdin from a file. Also, if the tostop setting of the terminal is enabled (you can set or query this by using the stty command), output from a background job causes the job to be suspended. |
Copyright IBM Corporation 1990, 2014
|