Use the pipe operator | to connect the output of one command to the input of another.
echo 1 | command
If you want to repeat some command input, you can use yes . By default, it re-sends the string "y", but also repeats another string of your choice.
yes | cp * /tmp
John kugelman
source share