Thanks for providing the line you use to avoid these errors - I'll definitely be including this in future bash scripts!
It makes you think - if we had these threads more often, perhaps we'd all get to learn more about these little process changes that could avert a disaster.