peterhpeterh 94011 gold badge88 silver badges1818 bronze badges one Most if not your whole concerns are already dealt with in other solutions here. None of the current answers suggest fast paced loops.Stéphane Chazelas' go through solution is effective on Mac OS X too if a looking through fd gets opened on /dev/fd/one.This may print the PID. In th