Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Mar 2009 16:17:47 -0800
From:      Bill Campbell <freebsd@celestial.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: the "yes" comand
Message-ID:  <20090305001747.GA13774@ayn.mi.celestial.com>
In-Reply-To: <op.uqak1hn5flcvyi@da1-desktop-x64>
References:  <op.uqak1hn5flcvyi@da1-desktop-x64>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 05, 2009, Vasadi I. Claudiu Florin wrote:
> Hell-o,
>
> Ever wondered about the "yes" command? Well, I have. If one does "yes"  
> into a terminal one get's an infinit output of "y" on a new line each  
> time. What's the deal here?

The ``yes'' command is designed to automate interactive scripts
that expect a repetitive string typed manually (e.g. something
like fsck but without the ``-y'' option).  One would use
something like:

yes | somecommand

It takes a single string argument so if you had a program that
always expected the string ``greblefarf'' one could use:

yes greblefarf | yourcommand

> I saw the same thing on linux, but you only had to type "y" (those cheap  
> blokes :P)

I don't know what you're talking about here.  To the best of my
knowledge, the yes command works the same on every version of
*nix I have used which goes as far back as Radio Shack Xenix in
1982 (the last real OS that Microsoft was responsible for :-).

Bill
-- 
INTERNET:   bill@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

The pinnacle of open systems is: when moving from vendor to vendor, the
design flaws stay the same.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090305001747.GA13774>