When you are architecting a massive automated bash script that executes a destructive command (like rm -i or fsck), the command will often pause the script and mathematically demand a manual human input (e.g., “Are you sure you want to delete this? y/n”). If you are running the script remotely overnight, this prompt will cause a catastrophic system hang. To mathematically force the Linux kernel to automatically bypass these interactive prompts and rapidly supply an infinite stream of affirmative responses, you must use the yes command.
Executing the Infinite Text Loop
The yes command is an incredibly simplistic but highly aggressive execution engine. Its sole mathematical purpose is to output a specific string of text to the terminal repeatedly, at maximum CPU speed, until it is violently killed by the operating system.
If you execute the command with no arguments:
yes
The exact millisecond you press Enter, the terminal will instantly explode with a massive, infinite wall of the letter y. The engine will consume CPU cycles outputting y thousands of times per second until you physically intervene and press Ctrl + C to deploy a kill signal.
Automating Script Prompts via Piping
The true architectural power of the yes engine is unlocked when it is chained into complex parsing pipelines.
If you have a chaotic script named destroy_logs.sh that will ask you “Are you sure?” 50 different times, you can mathematically bypass all 50 prompts simultaneously:
yes | ./destroy_logs.sh
The yes engine executes in the background. Every single time the script pauses and demands human input, the yes engine violently forces a y into the standard input buffer, instantly satisfying the condition and forcing the script to continue its execution path.
Customizing the Infinite Output
If a specific application demands a different confirmation character (e.g., the word accept or the number 1), you can mathematically alter the yes engine’s payload.
yes accept | ./install_software.sh
The engine will now pump an infinite stream of the word accept directly into the installer script, instantly bypassing any massive EULA agreements or configuration prompts without requiring a single human keystroke.