LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   automating using shell scripting (https://www.linuxquestions.org/questions/linux-newbie-8/automating-using-shell-scripting-208898/)

LinToWinWin 07-23-2004 06:33 PM

automating using shell scripting
 
I am using Mandrake Linix Official, and I am picking it up rather fast.

I am having some applications which prompt for username, password and then a couple of key press (for yes/no). One such is the vpn client.

As I need to start the program automatically when my system boots, or thro any mouse click, I am in need of a solution to pass the parameters to the program.

For example, I will put my requirement as below.

I have a program which runs as below

---------------------------------
Enter the first number : 2
Enter the second number : 4

Do you want to Add/Subtract/Multiply/Divide: Add

Result : 6

Program Completed.
----------------------------------

I want to automate it fully. (No arguments can be passed to the program)

Regards,
Shyam

afm 07-23-2004 09:57 PM

cat <<END_OF_ANSWERS | /path/to/your/unix/unfriendly/program
2
4
Add
END_OF_ANSWERS

This will only work if your program takes input from stdin. If not, then you must learn to use expect(1).


All times are GMT -5. The time now is 07:32 AM.