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.
zsh
4.3.10 install;% read a
works fine here.read
does work on Linux machines.