hey i can login into telnet with "telnet localhost 4242" now i want to execute a single command "show network".
How can i do this in one line ?
something like that
$ telnet localhost 4242 <- "show network"
woa here the output i want
hey i can login into telnet with "telnet localhost 4242" now i want to execute a single command "show network".
How can i do this in one line ?
something like that
$ telnet localhost 4242 <- "show network"
woa here the output i want
I found expect to do exactly what i want, wait for a certain output and then act upon it:
If you don't have to log in or anything, you can use a "here document" like this: