scripting an interactive program session


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
scripting an interactive program session

Hello,

I'm looking to script the basic instant messaging program we have in my company, it's called "oi", it's working as follow:

# oi $user

then we have to launch it...
after finding the system of the user it's asking for the message...

then on a new line we have to hit ctrl+d

I want to script that with the message included in one system command but can't find a way to go around the interactive shell session.

help!

-david
# 3  
Have you tried a "here document"? To type control characters, first press CTRL-V then CTRL-D:

Code:
# oi $user <<EOF
message text
<CTRL-V><CTRL-D>
EOF

Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Non-interactive login using C program in UNIX(Solaris)
munish259272
Hi i need a c programm to login in unix(solaris). non-interactivley because it seems difficult to do it with unix shell scripting and passwd command cant be used and also i don't have expect installed and i am not allowed to installed expect in our servers. is there any c programm that can help...... Programming
1
Programming
Non-interactive FTP within SSH session not working
Subu1987
Hello everyone! I am trying to log-in to a remote server over SSH, transfer file1 there, perform some checks, capture the results in file2 and transfer file2 back to my local server - all of this non-interactively. Initially, I tried to do this within a singe SSH session, using the following...... Shell Programming and Scripting
2
Shell Programming and Scripting
Develop Program with 'None Interactive Flag'
warlock129
Hi I have created a program but am currently wondering how to develop it further. I wanted to know how i would go about developing the program further so that it is able to run with a "none interactive flag" enabling execution to be automated with the resultant file e-mailed to a user once a week....... Shell Programming and Scripting
1
Shell Programming and Scripting
Running an Interactive Program Remotely
Terrible
now, i have a program that i would very much prefer to run remotely as i hate having to log into the box it is on. the problem is, every command i have tried to run this remotely doesn't work. the commands tries to kick off the program on the remote box but then hangs. like take for...... Shell Programming and Scripting
3
Shell Programming and Scripting
Making Interactive program
sivasenthil_k
Hi Friends I am trying to make an interactive shell script ( I do not have expect tool ) My objective is 1.I have a progam named say "inter" The program when ran on command prompt will be as below Prompt>inter Please enter the choice 1.enter 1 2.enter 2 < I need to enter 1 or 2...... Shell Programming and Scripting
4
Shell Programming and Scripting