GNU Info

Info Node: (libc.info)Missing Pieces

(libc.info)Missing Pieces


Prev: Continuing Stopped Jobs Up: Implementing a Shell
Enter node , (file) or (file)node

The Missing Pieces
------------------

   The code extracts for the sample shell included in this chapter are
only a part of the entire shell program.  In particular, nothing at all
has been said about how `job' and `program' data structures are
allocated and initialized.

   Most real shells provide a complex user interface that has support
for a command language; variables; abbreviations, substitutions, and
pattern matching on file names; and the like.  All of this is far too
complicated to explain here!  Instead, we have concentrated on showing
how to implement the core process creation and job control functions
that can be called from such a shell.

   Here is a table summarizing the major entry points we have presented:

`void init_shell (void)'
     Initialize the shell's internal state.  Note: Initializing the
     Shell.

`void launch_job (job *J, int FOREGROUND)'
     Launch the job J as either a foreground or background job.  Note:
     Launching Jobs.

`void do_job_notification (void)'
     Check for and report any jobs that have terminated or stopped.
     Can be called synchronously or within a handler for `SIGCHLD'
     signals.  Note: Stopped and Terminated Jobs.

`void continue_job (job *J, int FOREGROUND)'
     Continue the job J.  Note: Continuing Stopped Jobs.

   Of course, a real shell would also want to provide other functions
for managing jobs.  For example, it would be useful to have commands to
list all active jobs or to send a signal (such as `SIGKILL') to a job.


automatically generated by info2www version 1.2.2.9