Workarounds for bugs in some versions of BASH and grep.