yes - output a string repeatedly until killed
Synopsis
yes [string]...
yes option
Automatically Answering a Command Prompt
To run a command barfoo and automatically answer
y
to all of its prompts, type:
yes | barfoo
To output something instead of “y,” specify it as
an argument. To specify a certain number of times
to output, pipe yes through head with the number
to output as an option.
To use mv to move all of the files ending in
.sample
in the current directory to a directory
called live, but answer no to overwriting any
existing files, type:
yes n | mv *.sample live
To run a command farboo and automatically answer
five prompts with your username, type:
yes `whoami` | head -5 | farboo