Hi
I am new to Expect scripting. I have to connect to a remote server and capture the output. Here I need output of " send "list registered\r"" to be stored in a file. but after execution, /tmp/capture.txt is of 0 byte
#!/usr/bin/expect
spawn ssh abc@10.10.10.10 -p 5022
expect "Password:"
send "xyz123\r"
send "W2KTT\r"
send "list registered\r"
set var $expect_out(buffer);
set fid [open /tmp/capture.txt w]
puts $fid $var
interact
Can you please help me in fixing this