LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-23-2004, 06:33 PM   #1
LinToWinWin
Member
 
Registered: Mar 2004
Posts: 40

Rep: Reputation: 15
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
 
Old 07-23-2004, 09:57 PM   #2
afm
LQ Newbie
 
Registered: Jul 2004
Posts: 16

Rep: Reputation: 2
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automating lynx in a shell script yimboli Programming 15 04-04-2007 02:15 AM
Automating Bittorrent with shell scripts kyosuke Linux - General 4 07-01-2005 10:14 AM
Trouble when automating ftp with shell script hari_s_82 Linux - Newbie 2 09-23-2004 02:17 AM
Automating simple commands, scripting or programming? entob *BSD 3 09-01-2004 01:56 AM
Automating a playlist using shell script... DesiLILO Linux - Newbie 4 04-02-2004 11:03 PM


All times are GMT -5. The time now is 08:04 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration