Changes

Bash Shell Script Examples

1,017 bytes added, 02:31, 5 February 2016
The following lines were added (+) and removed (-):
=== Detach Command and Run in Background ===So if the terminal window is closed, the command continues to execute.  You can append an "&" to the end of the command. This detaches the command from stdin.  The & ampersand character is placed right of a space at the end of the command.  Keep in mind that the command’s process is still managed by the shell and stdout and stderr are still attached.  In some cases the process will be terminated if the shell session is closed.  It depends on how the process was written.When you append the "&" at the end you are able to use the command prompt again, however, output from the process is displayed in the same terminal.  You can redirect output to a text file or /dev/null. processname &> /dev/null &Now you have your command prompt back and will receive no messages, for the most part.To see the process running look at the jobs jobsYou will see it displayed.  You can detach it with the "disown" command.Now to deal with HUP.  Use "nohup."
Bureaucrat, administrator
16,192
edits