Connecting Tech Pros Worldwide Forums | Help | Site Map

Sending an input to a running application.

Newbie
 
Join Date: Sep 2009
Posts: 5
#1: Oct 6 '09
Hi Iam new to perl and need a help to send inputs to an running application :



I am running an application XXXX , and when it starts i am passing a file name called "connect.spb" and after the application connects to the server i am sending filename "accept.spb" as a parameter.

BL31DL385:$ ./XXXX

This is XXXX (Reproducer by Order or RelaY)


XXXX> @connect.spb

XXXX>Opening connect.spb

Script> SET TCPIP /LOCAL_PORT=15331
Initialised TCP Listener on BL31DL385 (port: 15331)


>@accept.spb

XXXX> Opening accept.spb

So basically Input parameters are @connect.spb and @accept.spb.
After getting first string application will connect to the client ,
Then wait for the input and when accept parameter is given communication established succesfully.



MyQuestion##can we automate this using a script which will first run the application XXXX, and then pass the connect.spb and accept.spb as input.

numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,572
#2: Oct 7 '09

re: Sending an input to a running application.


Quote:

Originally Posted by babp View Post

Hi Iam new to perl and need a help to send inputs to an running application :



I am running an application XXXX , and when it starts i am passing a file name called "connect.spb" and after the application connects to the server i am sending filename "accept.spb" as a parameter.

BL31DL385:$ ./XXXX

This is XXXX (Reproducer by Order or RelaY)


XXXX> @connect.spb

XXXX>Opening connect.spb

Script> SET TCPIP /LOCAL_PORT=15331
Initialised TCP Listener on BL31DL385 (port: 15331)


>@accept.spb

XXXX> Opening accept.spb

So basically Input parameters are @connect.spb and @accept.spb.
After getting first string application will connect to the client ,
Then wait for the input and when accept parameter is given communication established succesfully.



MyQuestion##can we automate this using a script which will first run the application XXXX, and then pass the connect.spb and accept.spb as input.

You can try using the Expect module in Perl, but it might be easier to figure out how to use the actual expect program in Unix.

Regards,

Jeff
Newbie
 
Join Date: Sep 2009
Posts: 5
#3: Oct 7 '09

re: Sending an input to a running application.


Thanks Jeff for this useful information , I'll try with Expect module.
Reply


Similar Perl bytes