Background
The yes
command is a means to automatically hit yes when dealing with multiple prompts that you know you will hit yes to. An example of yes
in action is depicted below from How to Geek:
yes | sudo apt-get install fortune-mod
This will automatically install everything in the package and hit yes to continue at each prompt. This example is excellent for describing an example of piping the output of yes to one command that will present several "y/n" outputs.
Problem
I have a string of commands I want to execute in tandem, and the last one will bring up several "y/n" prompts. Below is the draft version of my command:
yes | cat alistOfDirectories.txt | xargs -I{} cleartool rmname {}/bad_file.txt
Each time rmname
is invoked, a "y/n" prompt still pops up and then a whole host of other errors appear that derail the entire process.
Question
How do I properly pipe the output of yes
to the last command through several pipes?