How to pass variables to 3rd party unix menu?

Hello,
I was wondering if it is possible to pass data to a unix driven 3rd party menu. Changing the code is out of the question. I have a menu with various options and I would like a ksh to execute the menu and input the required fields. For example.

Main menu

  1. Company Name
  2. blah
  3. blah
  4. commit
  5. exit
    > 1 <enter>
    (option 1 selected)
    Enter Company name: BlahBlahBlah <enter>
    (Back to main menu)
    >4 <enter>
    (commited change and back to main menu)
    >5 <enter>
    (exited program/menu)

Do I need to pass variables to the menu's option and if so how?

greatly appreciated,

It seems like you would want to use the "expect" command. You may need to download it since it does not come with many OSes.

Thomas

Thanks,
Do you know if this works on AIX5.1?

I believe that I have compiled expect on AIX 4 something so I can't imagine why it wouldn't. I've never heard of any platforms where it won't work. It does require TCL but that is about it.

It is a very useful utility when you need to batch control interactive programs. The name implies its functionality (though broader). You supply conditions to "expect" and respond with actions accordingly.

Thomas