With Expect scripts you can automate interaction in the shell by letting the script automatically provide input in the terminal.