Jay wrote:
Okay... how would I implement that into my emerge then?
Well, you could go about it this way, but I'm sure there's plenty of other ways to do it as well...
First, you could change it to take $1 instead of $PID (or $PID = $1) to take the process ID from the first command line argument in your script, then when you run your emerge, the PID will be output if you toss it in the background ("emerge -u glibc &"), then you can type "./iopeyes ###" (replacing ### with the PID output from the last command) assuming you cleverly name your script the same way I would.
And if you wanted to take it a couple more steps, these couple ideas might give you a good reason to learn some BASH scripting and not have to ask that question again in the future:
1. Add output info to let you know when the process isn't found anymore (it finished), as well as when it's being stopped/started.
2. Add a break and quit when the process isn't found anymore so it takes care of itself cleanly and then you can toss that last command in the background as well and forget about it.