Or maybe you want to regex the output, and if it is empty, leave the loop.
In reply to Re: Non-buffered read from program by zentara in thread Non-buffered read from program by arc_of_descent