The Linux expect command allows you to execute scripts that control interactive programs. The expect scripting language is designed to make it easy to specify the interaction based on the expected output from the processes spawned by the script.
Like the screen utility, expect is probably not as widely known as should be, considering how useful it can be in automating procedures that are often quite time consuming when performed by a human operator. This may include testing of newly developed software, backup and maintenance procedures, or monitoring remote computer systems.
The expect utility may not be installed by default on your system. If you don't have root privileges it is possible to download the expect package and install it in your home directory.
There is also a version for Microsoft Windows operatiing systems.
For more information see the expect man page.