I have a process I'm that I'm constantly having to deal with.
- It requires I run a command and then enter several pieces of information.
- Then I'm presented with a curses menu listing several options.
The first half is easy to automate using expect. The second part I don't know of an easy way to automate.
Any suggestions?
Unfortunately, expect (from any language) is not really suited to something that isn't a standard screen buffer response. I've seen some implementations that attempt to deal with cursor position updates such as curses but the results are not always effective.
I feel that your time would be better spent researching what operations the curses app is giving you a menu for configure your application do do those items yourself. I've found that nearly every curses menu has a companion cli cmd, or is a front end for one.
If you can share what the curses menu is for the community might be able to assist you with whats going on in the background. If you cant because it's something home grown, you should be able to trap whats going on in the background with something like
strace
Hope this helps.
Take a look at the
hpuifilter
utility included with RANCID. It was originally written to help RANCID's expect scripts deal with the curses-like menus of HP switches. However, it's written as a filter, so you can pipe your curses application into it, and it will spit out the plaintext stripped of VT100 control sequences, which should be easier to deal with in expect.Dialog
http://invisible-island.net/dialog/