Welcome Guest [Log In] [Register]
Welcome to The New Coffee Room. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Tales of the Unix command line; Today: Saying Yes!
Topic Started: Jun 15 2017, 02:29 PM (68 Views)
Klaus
Member Avatar
HOLY CARP!!!
"Are you sure?"

"Do you really want to do this?"

"Absolutely certain?"

Have you ever been tired of questions like this?

Then yes is your friend. If you use OS X or a variant of Linux, you can just open a command line and type yes. But there are variants of yes for basically every operating system. I have yes on my cell phone.

What does yes do? Well, it takes care of all questions of the form above and answers them with an affirmative "y" or "yes". Using something called "pipes" you can ask yes to say "yes" to every question another program asks. You want to delete a large number of files but don't want to be asked again and again when there's a hidden system file among them? Use "yes". You are checking your file system and don't want to confirm that you really want to repair each file that needs to be repaired? Use yes.

And for the naysayers among us, you can start yes with the option "no" and it will answer every question with "no"!

Tiny programs like yes that look rather useless in isolation are what makes the Unix command line tools so great!
Trifonov Fleisher Klaus Sokolov Zimmerman
Online Profile Quote Post Goto Top
 
Axtremus
Member Avatar
HOLY CARP!!!
$ yes | wife
Offline Profile Quote Post Goto Top
 
Klaus
Member Avatar
HOLY CARP!!!
Axtremus
Jun 17 2017, 08:17 AM
$ yes | wife
I'd complete that to

$ yes | wife >/dev/null

or maybe

$ yes | wife | grep 'sex'

I guess the last one is already a pretty accurate approximation of most husbands ;)
Trifonov Fleisher Klaus Sokolov Zimmerman
Online Profile Quote Post Goto Top
 
jon-nyc
Member Avatar
Cheers
Klaus
Jun 17 2017, 08:21 AM
Axtremus
Jun 17 2017, 08:17 AM
$ yes | wife
I'd complete that to

$ yes | wife >/dev/null

or maybe

$ yes | wife | grep 'sex'

I guess the last one is already a pretty accurate approximation of most husbands ;)
Careful. That's how in-law visits happen.
In my defense, I was left unsupervised.
Online Profile Quote Post Goto Top
 
« Previous Topic · The New Coffee Room · Next Topic »
Add Reply