1: 2: 3: 4: 5: 6: 7: 8:
#!/usr/bin/expect -f set timeout -1 spawn (here goes your command) match_max 100000 expect "*?assword:*" send -- "yourpasswordhere\r" expect eof