Chapter 5 Process Managment in Unix (1)
Chapter 5 Process Managment in Unix (1)
Example: $ batch
sort /usr/sales/reports/* | lp
echo “Files printed, Boss!” | mailx -s ”Job done” boss
The user can specify the nice value explicitly with –n (number)
Example:
unit
Background Processes
When you start a process (run a command), there
are two ways you can run it:
Foreground Processes
By default, every process that you start runs in
the foreground. It gets its input from the keyboard
and sends its output to the screen.
Background Processes
Background Processes
A background process runs without being connected to your
keyboard.
If the background process requires any keyboard input, it
waits.
The advantage of running a process in the background is that
you can run other commands; you do not have to wait until it
completes to start another!
There can be only one job in the foreground, the remaining
jobs have to run in the background.
There are two ways of starting a job in the background:
with the shell’s & operator
nohup command.
Background Processes
& : No Logging out
The & is the shell’s operator used to run a process in the background.
The user can direct the shell to execute the command in the background.
In this case, the parent doesn’t wait for the child’s termination.
Example: