I have a bash script that is named reader. It reads user input:
#!/bin/bash
read -p "What is your name?" username
echo "Hello, ${username}"
Running the script by source reader (EDIT: from the zsh shell), I get the error reader:read:2: -p: no coprocess. It doesn't give this error when I run it as ./reader.
Other read options do not produce this error. For example, I could have done:
#/bin/bash
echo -n "What is your name?"
read username
echo "Hello, ${username}"
Where does the no coprocess error come from? What does it mean? And what should I do about it?