Answer the question
In order to leave comments, you need to log in
How to make automatic Y/N response in Bash script?
There is a bash script script.sh
During its execution, a prompt appears, which must be answered with y / n:
For example:
default: Are you sure you want to destroy the 'default' VM? [y/N]
Tell me how to tell the script to automatically answer "y" ?
Answer the question
In order to leave comments, you need to log in
1. If the script is your own, you can edit it to find where it asks and remove the extra question.
2. echo "Y" | script.sh
3. If the script asks different things, you can throw the answers into a file, for example, the answers.txt file:
yes
yes
no
and executescript.sh < answers.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question