Differences between current version and predecessor to the previous major change of JobControl.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 7 Last edited on Thursday, August 16, 2007 2:54:13 pm by BenStaz
Older page: version 3 Last edited on Wednesday, May 2, 2007 3:01:20 pm by BenStaz Revert
@@ -1,13 +1,36 @@
 In Unix you can run "jobs", suspend them, run them in the background, or bring them to the foreground. 
 The commands for this are: 
-;bg ''jobid '':Moves ''jobid '' into the background  
-;fg ''jobid '':Moves stopped, or backgrounded ''jobid '' into the foreground  
-; kill % ''jobid '':Send a signal to a job  
-;Control-Z:Suspend the currently running job  
-;jobs :List all current jobs
+This command will list all of the active jobs.  
+Some switches you may like to try include:  
+* ''jobs -r '' will display running jobs only.  
+* ''jobs -s '' will display stopped jobs only.  
+''bg <JOB_SPEC>'' moves the job into the background.  
+Note : if the job is currently in the foreground you will first have to suspend it using ''Ctrl-z '' ([SIGTSTP])  
+Note : To start an application in the background append ''& '' to the end of your command.  
+*ping &  
+''fg <JOB_SPEC>'' moves the stopped or backgrounded job into the foreground.  
+! kill  
+ ''kill %<JOB_SPEC> '' sends a signal to a job.  
+Note : you can use use ''kill -l'' to list the possible signals you could send
 !bg,fg and kill are not limited to jobids. 
 We can also specify the start or part of the job command. 
@@ -16,12 +39,12 @@
 *kill %ping 
 *kill %?google 
 *fg ping 
-*bg ?  
+*bg ?goo  
 These will work as long as you don't supply an ambiguous job_spec. 
-Notice that, only kill requires the ''%'' so that it knows we are providing it with a job _spec rather than a process id. 
+Notice that, only kill requires the ''%'' so that it knows we are providing it with a JOB _SPEC rather than a process id. 
 !!How this works 
 Internally each command line (job) gets it's own ProcessGroup assigned to it by the shell when it creates the job using [setsid(2)]. While the command is running in the foreground it recieves any signals from the tty layer (such as [SIGTSTP], [SIGINT], [SIGQUIT], [SIGHUP] etc).