Rewrite #520. Using `read var?'prompt'` is wrong. It is ksh (and zsh) specific. Using `read -p 'prompt' var` is also wrong. It is bash specific. Since we cannot assume which sh is implemented, we should write POSIX-compliant code.