[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash Scripting Question



The tool 'yes' can be used to write an infinite stream of strings
(the default being 'y') to standard output, so if your program needed
only a sequence of a fixed string such as 'y', you could do

> yes | your-program

or 

> yes "some-other-string" | your-program

But if your program is not reading strictly from standard input (there
are other ways to get keyboard/interactive input), then…

On Sun, Nov 03, 2013 at 09:58:58PM +0100, Erwan David wrote:
> Maybe you'll need something like expect to handle this.

I'd second expect, it's probably the best tool for the job in all
non-trivial cases.


Reply to: