I have a shell script plan.sh
which expects a user input (a/b)
and then asks for another input (y/n)
.
I want to run this in one line like sh -a -y plan.sh
which doesn't work.
I tried this too
./plan.sh << END_OF_INPUT
a
y
END_OF_INPUT
which throws an error:
/bin/bash: warning: here-document at line 0 delimited by end-of-file (wanted 'END_OF_INPUT')
Is there a way to do this better?