On Sun, Sep 20, 2009 at 11:44 PM, Raj Mathur raju@linux-delhi.org wrote:
On Sunday 20 Sep 2009, Manvendra Bhangui wrote:
On Sun, Sep 20, 2009 at 7:57 PM, Raj Mathur raju@linux-delhi.org
wrote:
echo -n "Hit space to continue: " read __dummy
it could be something like this #!/bin/bash ... ... echo -n "Hit space to continue" read -n 1 dummy
Which will cause bash to return after exactly one char is entered
That makes sense, in which case, if you have something like:
read num read -n 1 dummy read yn
you can run the script as:
... <<EOF 100 dy EOF
so num gets the value "100", dummy gets the value "d" and yn gets the value "y".
Thanks for the help. I must admit I was unclear. The task I am trying to automate is a built-in HP-UX utility which asks me lots of questions. I am required to repeat running this utility with answers to all questions except one being constant. Thats where I thought of creating a shell script with a here doc.
Unfortunately, the HP-UX utility is not a script - its a binary. I don't have access to my VPN right now so can't test the suggestions given by listers. I'll keep you informed.
Thanks again, Nadeem.