Zsh's read for some reason is echo'ing ^M's instead of accepting them as <Enter> keystrokes. (If -d is set, then they are recognized as <Enter>'s, but still echoed.) It also doesn't support basics like the backspace key.
I can get around this by hacking / running bash,
> a=$(bash -c 'read -e -p "What would you like to do?: " tmp; echo $tmp')
What would you like to do?: eat cake
> echo $a
eat cake
but I'm wondering if there's a cleaner way.
zsh4.3.10 install;% read aworks fine here. – u1686_grawity May 22 '12 at 22:04readdoes work on Linux machines. – Nicholas Tung May 22 '12 at 22:37