You can try the program expectavailable as a package for most Linux distributions. It uses a simple script language to feed interactive programs. An example script could be like this:
spawn passwordmanager
expect "Enter password for testuser:"
send "verysecret123"
This script would say to expectstart the program passwordmanager, and then wait for the invitation Enter password for testuser:and respond to it with verysecret123, etc.
source
share