I run a linux command that sometimes asks for user input (press 1 or 2).
I always want to answer 1, how can I pass this value automatically ?
Just a thought:
echo "1" | linux_command --with-arguments <&0
This works for commands which want input from stdin, because 0 is the descriptor for standard input. This question might better belong on Server Fault however...