Find a copy of Advanced Programming in the UNIX Environment (ISBN 0201433079) and read chapter 9, "Process Relationships", for what should be everything you need to know about implementing job control (and if you're writing your own shell you should already have a copy at hand anyhow :). You might also find the relevant portions of the code to zsh or bash to be of use.
| [reply] |
The facilities you describe are already delivered with unix (see man fg and it'll tell you about all the related commands). They can be found under Solaris in /usr/bin. When executing these from Perl (e.g. with the system command) there will be a shell process in between, so you'll have to give fg or bg the specific pid as argument. But you can get the pid when creating the background job, for example, if spawning it using Proc::Simple.
Update: To be more precise about the last point, having used the new and start methods, you can then use the pid method to retrieve its pid.
| [reply] [d/l] [select] |
The "Job Control" section of gnu libc info documentation can help a lot, it even has nice examples.
| [reply] |