Sometimes it can be tedious to enter certain data in the command line, especially if you have to repeat it several times.
Imagine ftp command line authentication. We can make use of the expect command...
Those of us who use Axway Appcelerator Titanium sometimes have to logout/login every time we change from one computer to another and validate the license again. Now anymore!. It will be easier if you modify and execute the following script according to your needs:
#!/usr/bin/expect spawn appc logout expect eof spawn appc login set timeout 2 expect "? Appcelerator ID:" send "email@example.com\r" expect "? Password:" send "your_password\r" expect eof
You have to change firstname.lastname@example.org and your_password.
You can use with other commands: ftp, ssh, etc...
Link: expect (man)