Ineteractive application handled using Expect script


 
Thread Tools Search this Thread
Top Forums Programming Ineteractive application handled using Expect script
# 1  
Old 12-01-2008
Ineteractive application handled using Expect script

Hi expert guys,

I have unix server where i have a application for some special commands. Below way to entering in that application-

bash-2.05$ telnet 11.13.58.39 2310
Trying 0.0.0.0...
Connected to ..
Escape character is '^]'.
CONNECTING TO...

PROCESS 2310 CONNECTED...

Enter command: LOGIN:user1asswd1;
RESP:0;
Enter command: GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875;
RESP:0:Profile,01:MSI,987012365875:RIM,987012365875
Enter command: LOGOUT;
RESP:0;
Enter command: Connection to . closed by foreign host.
$


Now i want to make a ineterface for a user "john" in same machine where User "john" will use the below ineterface. In fact, below ineterface will directly ineterct with above application(green colored).

Whatever the command "john" will put it will go first to above application and show the response in below john's interface-

login:john
password:***

Sun Microsystems Inc. SunOS 5.9 Generic May 2002
----------Welcome to John Command Interface----------

Enter Command or type EXIT to exit
GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875;
GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875;
RESP:0:Profile,01:MSI,987012365875:RIM,987012365875;
Enter command:

Enter Command or type EXIT to exit
EXIT

Now u see above "GET:SUBSCRIBERINFORMATION:SubscriberNumber,012365875;" comes twice. and "Enter command" prompt comes again. How do I stop viewing those?

attachment: -- user "john" .profile
-- expect script to inetract with the application

//purple

Last edited by thepurple; 12-01-2008 at 07:26 AM.. Reason: to add attachemnet
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Expect script returning string following a found expect.

I'm fairly new to scripting so this might not be possible. I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version: #show version ... (0 Replies)
Discussion started by: IBGaryA
0 Replies

2. Shell Programming and Scripting

SFTP or scp with password in a batch script without using SSH keys and expect script

Dear All, I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies

3. Programming

Calling another expect script inside an expect script

I have an expect script called remote that I want to call from inside my expect script called sudoers.push, here is the code that is causing me issues: set REMOTE "/root/scripts/remote" ... log_user 1 send_user "Executing remote script as $user...\n" send_user "Command to execute is: $REMOTE... (1 Reply)
Discussion started by: brettski
1 Replies

4. Programming

Calling expect script inside another expect

Hi, Am very new to expect scripting.. Can You please suggest me how to call an expect script inside another expect script.. I tried with spawn /usr/bin/ksh send "expect main.exp\r" expect $root_prompt and spawn /usr/bin/ksh send "main.exp\r" expect $root_prompt Both... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

5. Shell Programming and Scripting

Need help with Expect script for Cisco IPS Sensors, Expect sleep and quoting

This Expect script provides expect with a list of IP addresses to Cisco IPS sensors and commands to configure Cisco IPS sensors. The user, password, IP addresses, prompt regex, etc. have been anonymized. In general this script will log into the sensors and send commands successfully but there are... (1 Reply)
Discussion started by: genewolfe
1 Replies

6. Shell Programming and Scripting

My error is not being caught or handled

Hi, I my ksh script I have the following: ##--Checking the spool file for errors NumberOfErrors=`cat $CurrSpoolFile | grep " ORA-" | wc -l`my logfile shows this: PL/SQL procedure successfully completed. PL/SQL procedure successfully completed. BEGIN... (1 Reply)
Discussion started by: ramangill
1 Replies

7. Shell Programming and Scripting

Number of fields handled by awk

Hi Gurus, Have a file seperated by "~" and no of fields is 104. When i try to run awk, it erros out. awk: record `B~A31~T24_STF~~~2009...' has too many fields Any idea how can i extract a specific filed with this many fields in a row. Kindly help (3 Replies)
Discussion started by: srivat79
3 Replies

8. Shell Programming and Scripting

Move files one at the time and wait until the previous file is handled

I'm a novice at unix and need it more and more to do my work. I seem running into problems getting this script "attempt" to work: I need to copy all files in a directory, which is containing 22000 files, into a directory one level up. There a tool monitors the content of the dir and processes... (2 Replies)
Discussion started by: compasscard
2 Replies

9. Shell Programming and Scripting

strange expect script behavior, or am i misunderstanding expect scripting?

Hello to all...this is my first post (so please go easy). :) I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Discussion started by: v1k0d3n
2 Replies

10. Linux

Maximum number of threads handled by a process????

Hi Anybody knows max. no. of threads handled by a process in linux. Please reply Thanks in advnce :confused: (0 Replies)
Discussion started by: Agnello
0 Replies
Login or Register to Ask a Question