On Sunday 20 Sep 2009, Nadeem M. Khan wrote:
On Thu, Sep 17, 2009 at 10:01 PM, Raj Mathur raju@linux-delhi.org
wrote:
On Thursday 17 Sep 2009, steve wrote:
[snip] Ummm, the literal space (" ") character doesn't work ? ...before command3 (as in ") command3" or after command2 (as in "command2 ") ?
Not clear on what the OP wants, so no comment here.
Raj, I thought I was pretty clear in explaining what I needed. Let me give an example of how a sample script works with user intervention, and then without user intervention, autmated by here documents.
With user intervention:
#samplescript.ksh Are you sure you want to continue (y/n) ? y Enter number of blah blah[1-1000] 500 Hit the space bar to continue: I have to hit space bar here Are these setting correct? (y/n) y
Presumably the script is using a dummy "read" shell built-in to read the space bar. If that is the case, an empty line in the input (or a line containing anything at all) will do the job. Something like this in the script:
echo -n "Are you sure (y/n)? " read yn if [ "$yn" = "y" ]; then ... fi echo -n "Enter number: " read num echo -n "Hit space to continue: " read __dummy ...
If the script is actually reading the space bar (and not a whole line) then it looks like it's using some program to put the keyboard into raw mode (as opposed to cooked, line-by-line mode), in which case you'd have to check exactly how the input is being read so you can feed it through the here document. Can't say more without seeing the actual script.
Regards,
-- Raju