Enter a letter when prompted by another command

Posted by kij on Stack Overflow See other posts from Stack Overflow or by kij
Published on 2010-06-10T09:32:43Z Indexed on 2010/06/10 9:43 UTC
Read the original article Hit count: 139

Filed under:

Hi all,

I'm trying to automate the installation and deployement of an application.

To do it, i have a shell script with the following instructions:

/usr/local/bin/amf install -u $1 -p $2 $localTarget

where $1, $2 and $localTarget are options for the command named 'amf'.

The problem is that the 'amf' command make severall instructions and ask the user to enter a letter during those instructions (to confirm the installation). At the moment, i can't bypass or modify the behaviour of the 'amf' command, so my question is:

How can i catch this behaviour and/or automatically enter a letter in my script.

This behaviour currently make my script not working, because the 'amf instal...' instruction is followed by another command to start my application. But as the install failed, the application can't start.

Thanks in advance for your help.

Best regards.

Kij.

© Stack Overflow or respective owner

Related posts about shell-scripting