Previous | Table of Contents | Next |
DESCRIPTION
The internal suspend command is actually a keystroke and a command. The default keystroke is Ctrl-Z. The Ctrl-Z suspends the current process. The process is placed in a suspended state and interactive control returns to the parent shell. For instance, assume you start a long process, such as cd /; 1s -1R > /tmp/ls.out, and forget to place the command in background. You can suspend it and then place it in background for further processing.
The Ctrl-Z is used to suspend any type of process that handles the suspend signal. It can be typed at any time. If the current process traps the suspend signal, the Ctrl-Z is processed and the job is suspended.
The suspend command can only be used while you are at a shell prompt. It is used to suspend a background job.
COMMAND FORMAT
Following is the general format of the suspend command.
suspend Ctrl-Z
RELATED COMMANDS
Refer to the bg , fg , jobs , kill , and stop commands described in modules 9, 51, 68, 70, and 125.
APPLICATIONS
The suspend command provides a way to switch between multiple shells . You might have a login shell, a subshell in a different directory, and a su shell running simultaneously . To change between the three shells you can use the suspend command. You may need to use the jobs command. You must use the fg % job or bg job command to restart a suspended shell or process.
The Ctrl-Z key is useful when you are controlling processes within the same shell. You can toggle between vi and your shell using the Ctrl-Z key.
TYPICAL OPERATION
In this activity you use the suspend command to switch between two different shells. Begin at the shell prompt.
cj> suspend [1] + Stopped (signal) PS1=memo-$PS1 ksh
cj> jobs [1] + Stopped (signal) PS1=memo-$PS1 ksh
Previous | Table of Contents | Next |