unix command 'yes'
Huh, I had never seen this one before.
Not sure if it is actually useful.
Anyone here use it much?
CC
February 3rd, 2010 2:37pm
yes | rm /
Likely Longer
February 3rd, 2010 2:41pm
I guess that is like deltree *.* /Y
JoC
February 3rd, 2010 3:14pm
Kind of.
yes | rm -R /
Likely Longer
February 3rd, 2010 3:17pm
man yes
xampl
February 3rd, 2010 3:53pm
"man yes" -> "output a string repeatedly until killed"
See, this is what's wrong with Unix. There's NOTHING about the word "yes" that says to ME "output a string repeatedly until killed" -- but that's what it means to Unix.
What's wrong with "repeat", or "emit_forever"? And if you WANTED to output a string repeatedly, there's no 'reverse lookup' that would tell you some RAVING LUNATIC put that behavior under the magic word "yes".
And note "no" gets no "special" abilities -- which if "yes" was so special, shouldn't "no" do something special too?
Gahhhhhhh!
SaveTheHubble
February 3rd, 2010 4:00pm
yes no
Likely Longer
February 3rd, 2010 4:05pm
> man yes
woman headache
Billy the Fish
February 3rd, 2010 4:24pm
"There is no logic to the name" - StH
Agreed, until you know what the first guy who wrote it used it for.
He had some program that kept asking "Continue? (Y/N)" To skip all the prompts, he wrote yes and piped it in.
CC
February 3rd, 2010 4:29pm
"There's NOTHING about the word "yes" that says to ME "output a string repeatedly until killed" -- but that's what it means to Unix."
Yes there is. It's a pun on yes men, people who say yes to everything.
"What's wrong with "repeat", or "emit_forever"?"
Are you nuts? Who is going to type "emit_forever" on a command line?
"And if you WANTED to output a string repeatedly, there's no 'reverse lookup' that would tell you some RAVING LUNATIC put that behavior under the magic word "yes"."
Again, yes there is a reverse lookup. Try "man -k" (-k for keyword search).
See, the trouble is that Unix was designed for people with a sense of humor. If you lack that vital attribute you will not be happy. Unix was not written with literal "Captain Obvious" types in mind :-)
Q
February 3rd, 2010 4:30pm
>> There's NOTHING about the word "yes" that says to ME "output a string repeatedly until killed" -- but that's what it means to Unix. <<
Unix is like the Star Trek TNG episode where Picard is trapped on the planet with the alien who spoke in terms of shared experience. If you didn't know their race's history and context, you couldn't understand them.
xampl
February 3rd, 2010 4:30pm
Right. "Unix" was evolved. Many things are agreed upon instead of mandated by a single entity.
Likely Longer
February 3rd, 2010 4:33pm
Darmok and Jalad on the ocean.
Darmok and Jalad at Tanagra.
CC
February 3rd, 2010 4:38pm
nonono is an alternative.
Likely Longer
February 3rd, 2010 4:40pm
Tanagra, the tasty salad dressing that's also a shoe polish.
Bored Bystander
February 3rd, 2010 4:45pm
Oh! How sweet, a 'man' option I was unaware of until now.
Note "man man" says the -k option "is equivalent to apropos". So now, you have to know what "apropos" does -- OR, your sysadmin has had to enable apropos, because I don't think it's enabled by default.
But thanks for that -- that will help a lot in the future. Clearly I've needed it for a really long time.
SaveTheHubble
February 4th, 2010 8:35am
Before man -k/apropos can be used the sysadmin has to create the keyword index the first time round. This is usually an operation that has be performed manually after the system is installed.
Q
February 4th, 2010 9:55am