#!/usr/bin/expect set timeout 10 set host [lindex $argv 0] set port [lindex $argv 1] set pass [lindex $argv 2] spawn telnet $host $port expect "password:" send "$pass\r" expect "Logged in successfully" #send "say 'This is a test (shutdown command) (no, it is not actually shutting down, hence the test).'\r" send "saveandexit 0\r" expect eof ##!/usr/bin/env sh #host=$1 #port=$2 #pass=$3 # #telnet $host $port <