in reply to Re: Is Process Running In The Background?
in thread Is Process Running In The Background?
I needed a change in this as the system call on HPUX gets the shell into a waiting state until it receives some input, which does not work well if we run it as a background process. Rather than skip doing this as a check, which we could do as the script is run manually at times, I wanted a way to have it run only when we needed it.$tpgrp = tcgetpgrp(fileno(*TTY)); $pgrp = getpgrp(); if ($tpgrp == $pgrp) { system("which which > whichtest"); } else { print "Skipping which as we are not interactive.\n"; }
|
|---|