#!/usr/bin/expect set user username #the username configured on router set pass "password" set hostname [lindex $argv 0] #set config set timeout 60 spawn ssh digicom_noc@$hostname # -------------- do not edit below -------------- # #get data from remote devices expect "password:" send "$pass\n" expect ">" send "show bgp summary | find AS | except inet | no-more \n" expect ">" send "exit\n" exit 0