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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -