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
Post a Comment