read command in zsh throws error

If you want emulate pause command in your shell, read is the most used command.
In bash works without problems:

read -p $'Press enter to continue...\n'

... but in zsh the argument -p is for coprocess, for that reason returns:

read: -p: no coprocess

To have a generic code to emulate pause command (independent of your shell), is better use the following sentence:

printf 'Press enter to continue...\n';read ans

Enjoy it!



Comments

Popular posts from this blog

How to fix Android when developer options are not available for this user

How to install Matlab without GUI

Contiki 3.0 on XM1000