the "yes" comand

Matthew Seaman m.seaman at infracaninophile.co.uk
Wed Mar 4 23:19:28 PST 2009


Kurt Buff wrote:
> On Wed, Mar 4, 2009 at 16:06, Vasadi I. Claudiu Florin
> <claudiu.vasadi at gmail.com> wrote:
>> Well , I noticed that, but it's a bit odd now isn't it. I mean, what's the
>> sense of having some darn letter printer out forever ? I found it kind of
>> silly If you ask me.
> 
> But, incredibly useful if you actually write shell scripts - many
> programs want a 'y' for input from the stdin, and this will do that
> for you.

Here's an example.  When upgrading FreeBSD, especially over a large delta
in version numbers, you will frequently need to delete old files etc. that
are no longer part of the base system.  You are provided with a mechanism
to do that, viz:

   # cd /usr/src
   # make check-old 
      {prints out all old files, directories and libraries to be deleted}
   # make delete-old
      {prompts you to delete anything apart from shlibs which it won't touch}

However 'make delete-old' will ask you whether you want to delete each
and every individual file, which is tedious.  If you decide from your
inspection of the 'make check-old' output that you don't want any of the
old files, you can just run:

   # yes | make delete-old

Job done.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090305/616b9d32/signature.pgp


More information about the freebsd-questions mailing list