Telnet 3270 example

Was wondering if anyone has good examples/reference material on interfacing to mainframe systems. Currently we use a Telnet 3270 emulator, and a typical interaction with it would be:

(1) Connect to the mainframe.
(2) Enter username and password.
(3) Select a view or do a search for records.

How does one even begin to write say a shell script to do the above steps using standard unix telnet? Any examples?

:confused:

If you searched the site using keywords, telnet script, you would find many related posts:

Hi, specifically after telnet 3270 examples, of which there is nothing: