Look To Yes To Breeze Through Dialog
By Taylor Gillespie
Expert Author
Article Date: 2011-04-27
For true professionals only, the command is part of the GNU Coreutils and expected to be installed on most all Linux systems. The command both lets you get what you want done when you know exactly what you want to do and also, with it, you can stress-test your processors, and even spot-check fatal hardware issues by keeping the system busy. It may seem simple at first glance, but the yes command is there for professional users that know exactly what a given action will do and does not have to interactively babysit the process.
The yes command takes --help and --version options, but otherwise, its manpage is as simple as it gets. The command will "Repeatly output a line with all specified STRING(s), or `y'." While many programs have options to automatically confirm all dialogs, the yes command provides a portable mechanism that works across most every Unix-type system. Piping the output from yes, without any options, into an interactive command-line program that expects confirmation of an action with "Y/n", and you know you will want it to be 'Y', then the output of yes will do that for you without needing to come back and check on it. For example, as root, "yes | cpan -i MODULE::NAME will install the module and answer "Y" to all dialogs. Provide yes with a string, and it will happily, and infinitely, echo the string. Answering "yes" or "no" to all dialogs is a dicey proposition even for seasoned professionals, so use this enomorous power with caution. As a sideeffect of the yes command continuely processing in an infinite loop, it can also be used as a way of stresstesting a machine's processors. Send the output to /dev/null and watch your processors churn away. If you are having a hardware-related issues with your processors or with your other components only when the processors are fully being utilized, this command will keep your processor occupied while you watch for problems.
With power comes responsibility and all, so don't hold me accountable for saying yes or no to every dialog prompt, but when you know you want to confirm or deny every dialog, yes is a portable method of achieveing that goal, and it can also be used to keep your processors busy for when they are too idle. Use yes and watch your processor levels spike. With more than a few processors it takes a few 'yes' processes to really max out a system. A simple, overlooked program that will soon have you just saying 'yes'.
About the Author: Taylor is a Staff Writer for WebProNews
|