I want to redirect the telnet console logs to a file in Linux.
For example:
telnet $someIp > someFile
#ls
#exit
I want the console logs to be saved in the filename someFile
. I am using tcl
for automating this. As of now, I am doing spawn telnet $someIp
in tcl
.
This will not capture the console logs and save it to a file.
Can this be done?
Redirecting output to a single file and screen: You can also append the redirected output by utilizing the “-a” or “–append” option with the tee command. -a or –append option allows tee command to append files rather than overwriting the file's content.
You can do it by using the tee
command:
telnet $someIp | tee -a -i someFile
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With