Subject: Re: "yes" curiousity
To: Michael G. Schabert <mikeride@prez.org>
From: Paul Mather <paul@gromit.dlib.vt.edu>
List: port-alpha
Date: 06/22/1999 22:04:24
On Tue, 22 Jun 1999, Michael G. Schabert wrote:

=> Hi guys,
=> As I was doing a make build, I happened to watch as it was doing stuff in
=> /usr/src/usr.bin...& was curious when I saw this thing called "yes". So I
=> read the manpage. When I read it, I thought to myself "now that seems
=> really stupid. Why would anyone want to do that?" So, being the
=> sometimes-adventurous sort, I went ahead and typed "yes".
=> 
=> That brings me full circle to my original thought...that seems awfully
=> stupid. Why would anyone want to do that?
=> 
=> It took me forever to get my ctrl-c command through, what with the
=> incessant scrolling & all. Is there actually an application for such a
=> command, or did I miss something?

Although the NetBSD man page for "yes" doesn't provide a possible raison
d'etre for this command, the Digital Unix folks do (they even provide an
[albeit contrived] example):

yes(1)                                                       yes(1)

NAME
  yes - Affirms repetitively

SYNOPSIS

  yes [explication]

DESCRIPTION

  The yes command repeatedly outputs y, or the locale's equivalent of a y,
  or, if specified, explication.  (The LC_MESSAGES variable determines the
  locale's equivalent of y or n (for yes/no queries)).

  The yes command is useful for providing continuous input to a program.
  Terminate output by pressing the Interrupt key sequence.

ENVIRONMENT VARIABLES

  LC_CTYPE Determines the behavior of character classes used in the extended
           regular expression defined for the yesexpr locale keyword in the
           LC_MESSAGES category.

  LC_MESSAGES
           Determines the locale for the processing of affirmative responses.

EXAMPLES

  To delete all files in a directory (using the rm command) and automatically
  send an affirmative response to the request for confirmation, enter:

       yes | rm -i *




Cheers,

Paul.

e-mail: paul@gromit.dlib.vt.edu

"I don't live today; maybe tomorrow..."
	--- James Marshall Hendrix