sh: read: -p: no coprocess

Just thought I’d throw this out there since I don’t see many google hits on it. The problem (on OpenBSD 4.4):

$ read -p "Enter input: " MYVAR
sh: read: -p: no coprocess

Oh, of course, “no coprocess”! Surely, if I can somehow just add a “coprocess” then my read command will work… </sarcasm>

Anyway, I dug through info sh to see how the read command works on my OpenBSD system. Apparently one needs to format the command like this:

read MYVAR?"Enter input: "

This entry was posted in HOW-TOs. Bookmark the permalink.

One Response to sh: read: -p: no coprocess

  1. Unknown says:

    Thank you for the info! My androids terminal didn’t work with the normal “read -p”, this worked though.

Leave a Reply

Your email address will not be published. Required fields are marked *