linux - Bash script - Auto fill answer -


i have bash script has several questions, possible automatically fill answers ?

./script.sh install  

answers in order y 2 1 n n

how can in bash ?

edit: possible pass first answer ?

echo "y" | install  

and let choice user answer next questions ?

i pass here document stdin:

./script.sh install <<eof y 2 1 n n eof 

if want on 1 line, can use echo:

echo -e "y\n2\n1\nn\nn" | ./script.sh install 

however, prefer here document solution since imho more readable.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -