How to execute application command in shell script?

friends,
i have application commands to execute in shell script it is something like this. i will login with user data it takes me to $ prompt. Example given below

login: data
ps : xxxx
$ MNSinput --this takes me to greater than prompt >
> ops --this is command i enter this output has to get redirect then next command
> proc - This output also has to get redirect to file

The below script not working output of application command not getting redirected. Pls help in getting solution.

df -k  >> GUR_DG1_HC_$lnodee;
echo '------------------------------' >output
  {
       sleep 5
       echo datagrid
       sleep 3
       echo datagrid
       sleep 3
       MNSinput  
       sleep 5
       ops >> output
       sleep 5
       proc >> output
       sleep 5
       echo exit
}| telnet 10.185.43.23

---------- Post updated at 02:08 AM ---------- Previous update was at 02:06 AM ----------

sorry small change in script

df -k > out
echo '------------------------------' >>output
{
sleep 5
echo datagrid
sleep 3
echo datagrid
sleep 3
MNSinput 
sleep 5
ops >> output
sleep 5
proc >> output
sleep 5
echo exit
}| telnet 10.185.43.23

---------- Post updated at 05:42 AM ---------- Previous update was at 02:08 AM ----------

Friends,
pls provide solution for the above script

Not sure I understand your request. What exactly is going wrong?

hi,
I am not able to redirect the output of application command in solaris in simple to understand the script is something like this

$ MNSinput --this application command takes to > prompt (greater than prompt)

> ops - this is application command, want to redirect output of this command to file

> mns- this is also application command, want to redirect output of this command to file

So i am not able to redirect output for above.

Hi have two date and format is yyyy-mm-dd
start_dt and end_dt. I need to find the difference and fetch the dates in between start_dt and end_dt. Please he me how to write the shell script.

Sorry new to this group..no idea and wondering where to post new thread . I do not see such option in my screen. any help is greatly appreciated.
Txns Divu

Hello springs,
You joined the UNIX and Linux Forums October 2, 2007... That doesn't really match with "new to this group". It also looks like you have tried to hijack a couple of other threads in the past, but weren't given infractions. (You also did not receive any responses to those posts. If you had started new threads then, you would have been much more likely to get a response.)

Look at the private mail that was sent to you yesterday when you received the infraction for hijacking this thread. It provided complete instructions describing how to post in the forums as shown below:

Note that you can click on any of the underlined text above to open a page in your browser related to that text.

Please also review the forum rules.

You didn't answer the question - what is going wrong? Any error messages? Why do you pipe the group command's results to telnet if those results are basically empty (disregarding the two datagrid constants)?

Guessing: You want the output of MNSinput to go to a file, executing two (internal) commands ops and mns . Try

MNSinput <<EOF >>output
ops
mns
EOF