@Caleb Btw - were you inclined to post your solution (possibly with commentary) to that
Unix.SE Q&A? Yours is more elegant than the perl one posted, and I'd prefer perl to python... But if not, I'll accept one of the correct answers provided. No rush, of course: but if you're intending to post, I'll hold off.