In the shell, I would like to ask the user to choose between one of two options, then when either the 1 or 2, do a switch statement with it. How can I go about doing this.
echo "Press [1] to transfer to $drive1"
echo "Press [2] to transfer to $drive2"
read #input somehow?
I've tried making the second echo into a read. But ideally I'd like to put the two echo
s into a here document, then apply that to a read
but I could not get the lines correct.
options <<_EOF_
"Press [1] to transfer to $drive1"
"Press [2] to transfer to $drive2"
_EOF_
read $options -n 1
But I get the error line 7: options: command not found