Help with "su" command within a script

Hope someone can help here.

I need to be able to :

  1. su from a script

  2. execute a command which takes me into a application

  3. execute a command within this application.

I can do 1. & 2. with :

su - ggatea -c "/era/opt/er/7.0.0.1/ggsci"

This takes me to the application prompt where I then want to issue a further command : "info all" which gives me information on the apps therein.

Anyone help me ? :confused:

check out "expect"