bash - How to pass multiple keyboard inputs along with linux command -


i run linux command asks user input (press y or n).

after same command need pass (yes/no)

i want answer y,and after yes, how can pass value automatically ?

for 1 argument knew can use echo y|command

but,for multiple inputs not know how????

after passing y, should able give yes there way???

use yes utility

you can use yes command if want pass same value. example:

yes | ./script.sh 

use expect, variables, or configuration files

if need more complex, yes can't want directly. instead, should use expect script complex interactions, or rewrite shell scripts use variables or configuration files pass parameters.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -