Re: the "yes" comand

2009-03-07 Thread Pierre Guinoiseau
Matthew Seaman wrote:
> Kurt Buff wrote:
>> On Wed, Mar 4, 2009 at 16:06, Vasadi I. Claudiu Florin
>>  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
> 

Or you can also do:

  # make BATCH_DELETE_OLD_FILES=YES delete-old

;)



signature.asc
Description: OpenPGP digital signature


Re: the "yes" comand

2009-03-05 Thread Tim Judd
On Wed, Mar 4, 2009 at 11:35 PM, Wojciech Puchar <
woj...@wojtek.tensor.gdynia.pl> wrote:

> if you have program that do too much questions like (are you sure), and you
> are sure then you do
>
> yes|program


yes  Continue | Vista -uac

Bit o' humor in an otherwise too-serious world.  Laugh.  It'll make you
happy.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: the "yes" comand

2009-03-04 Thread Matthew Seaman

Kurt Buff wrote:

On Wed, Mar 4, 2009 at 16:06, Vasadi I. Claudiu Florin
 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



signature.asc
Description: OpenPGP digital signature


Re: the "yes" comand

2009-03-04 Thread Wojciech Puchar
if you have program that do too much questions like (are you sure), and 
you are sure then you do


yes|program

On Thu, 5 Mar 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?


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


So... what's going on ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: the "yes" comand

2009-03-04 Thread Vasadi I. Claudiu Florin

thx Bill, got the picture now.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: the "yes" comand

2009-03-04 Thread Bill Campbell
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:   b...@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.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: the "yes" comand

2009-03-04 Thread Kurt Buff
On Wed, Mar 4, 2009 at 16:06, Vasadi I. Claudiu Florin
 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.

Kurt
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: the "yes" comand

2009-03-04 Thread Vasadi I. Claudiu Florin
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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: the "yes" comand

2009-03-04 Thread Glen Barber
On Wed, Mar 4, 2009 at 7:01 PM, 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?
>
> I saw the same thing on linux, but you only had to type "y" (those cheap
> blokes :P)
>
> So... what's going on ?

man yes


-- 
Glen Barber
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"