#!/usr/bin/expect set timeout 20 set cmd [lindex $argv 0] set path [lindex $argv 1] spawn $cmd $path expect "Email address:" send "__EMAIL__\r"; expect "Password:" send {__PASSWORD__}; send "\r"; expect "Retype password:" send {__PASSWORD__}; send "\r"; interact