lukas@ihlpf.ATT.COM (00771g-Lukas) (02/04/89)
I was looking for a simple, unambiguous, portable technique that could determine when a process had been invoked async. The consensus seems to be that there is none. There were some suggestions (see below) to try, but it seems that they are open to ambiguities. 1) For ksh. If the target process is in a process group whose leader is not an interactive shell, then the process is probably async. This test is possible because ksh creates a new process group for async commands. However, there is no guarantee that this will always be true. 2) For shells that support job control. The test is similar to that described for 1 above. The caveat here is that process's *can* (although not necessarily *will*) be moved between the foreground and background arbitrarily (from the perspective of the target process). I want to thank Steve Friedl, Gregg Siegfried, Guy Harris, Dan Bernstein, Dave Turner (I apologize to anyone that I missed) for their detailed mailings on this subject. They helped a lot toward my understanding, a little more, exactly what-is-going-on! :^) -- John Lukas att!ihlpf!lukas 312-510-6290