put cisco conf in file
shconf.sh:
#!/usr/local/bin/expect -f
set timeout 30
spawn telnet [lindex $argv 0]
match_max 100000000
expect ogin {send login\r}
sleep 1
expect assword {send pass\r}
sleep 1
expect “>”
send “terminal length 0\r”
sleep 3
expect “>”
send “show configuration\r”
sleep 1
expect “>”
set fid [open [lindex $argv 0].log w+];
set tempvar1 $expect_out(buffer);
puts “this is tempvar \n $tempvar1”;
puts $fid $tempvar1 ;
expect eof
./shconf.sh cisco_1