Re: [SLUG] bash - moving up a notch

From: Eben King (eben1@tampabay.rr.com)
Date: Wed Oct 05 2005 - 18:08:04 EDT


On Wed, 5 Oct 2005, Mike Branda wrote:

> anybody know how to in essence "auto fill" a read in sh/bash??
>
> for example:
>
> foo.sh runs another program inside itself that asks a question and then
> waits for a return off of a read. Based on a test of the question
> (redirected from stdout?) a predefined variable is entered as the answer
> and then returned somehow to the inside program.
>
> Is this possible? I have a config program that has to be run multiple
> times (different machines) with the same answers.

Might /usr/bin/yes help? If the app doesn't flush the input buffer, you
might be able to get by with something like "app < responsefile". Also look
into "chat" or "expect" if those can't do it.

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?           [TOFU := text oben,
A: Top-posting.                                       followup unten]
Q: What is the most annoying thing on usenet?        -- Daniel Jensen

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:56:26 EDT