Shell script answer prompts?

Hi,

I'm writing a script that calls a function to generate a certificate. In generating this certificate, I'm asked a series of questions. I was wondering, is there a way to pre-program my script to answer these questions in the same way all the time. I saw something like

EOF>>
y
EOF

Assuming y is the answer I want. If I get like 5 questions and I want answers other than y for each question, how would that work? Thanks!

Elt

Have you tried piping the answers:

echo 'Ans1\nAns2\nAns3" | your_sript

Actually, the interactive question is not generated from a script I wrote. It's a java tool which ask me questions to create a certificate based on it. I guess my solution probably lies in trying to be able to program my script to answer these interactive questions which I'm not exactly sure how to do

Never mind, I actually got it to work using the:

command << EOF
answer
EOF

Thanks anyways

1 Like

Hello,

can you please tell me how to send "enter" as part of answers in the above trick!!
say here Ans1 = Ans2 = Y and Ans3 being the "enter"

-ilan