Query on sending inputs to a running application

Hi I need a help for below :

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.

DL385:$ ./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

Yes.

Use "expect".

See an example at A Y2K Problem solved with Expect

You'd do something like

#

!/usr/local/bin/expect -f
spawn Order
expect "XXXX>"
send "@connect.spb"
expect "Initialised TCP Listener"
send "@accept.spb"

and so on, or use "interact" if oiu want to return to keyboard control.