I have a program that runs from the command line. As soon as it runs, it asks for a text value and expects the return key to be pressed after that.Is that possible to create a bash script that runs that program, wait a little bit for the prompt to appear (lets say 2 seconds) and then provide the text and the enter key?EDIT:I have created this script with expect but it is not working:#!/usr/bin/expect -fset timeout 15set user myusernameset server x.x.x.xspawn ssh -l $user -p AAAA $serverexpect myusername@x.x.x.x's password: send the password\rwhere AAAA is the port and x.x.x.x the IP.when I run this script it finishes almost immediately and nothing happens.
Running a program and providing input
bash;command line;input;programming
It is working now, but I changed the script to:#!/usr/bin/expect -fset timeout 15set user myusernameset server x.x.x.xspawn ssh -l $user -p AAAA $serverexpect myusername@x.x.x.x's password:  { send the password\r }interact