Here is a line from a bash script I am trying to understand:
echo "spawn myscript.sh arg1 arg2; expect \"Please enter your value: \"; send \"myval\r\"; expect eof" | expect
I think I understand the first expect and the send.
Q1: Does expect work only with spawn?
Q2: What is the purpose of the last expect after the pipe?
Q3: In general, can you guess what the original author of this line was attempting to accomplish?