[NTLUG:Discuss] Scripting help

Eric Schnoebelen eric at cirr.com
Mon Oct 13 13:57:51 CDT 2014


Leroy Tennison writes:
- Well, interesting result, it obviously did telnet to the devices
- (got Trying .., Connected to..., Escape character is ..)  but
- then "Connection closed by foreign host." before ever showing me
- the login screen (three times, once for each device in my list)

That's likely because telnet  does not have standard input when
executed via xargs.  So, telnet gets connected, then tries to
read from standard input, gets an EOF, and starts shutting down.

- On 10/09/2014 09:13 PM, Christopher Cox wrote:
- > On 09/24/2014 10:24 PM, Leroy Tennison wrote:
- >> I'm trying to get telnet to repetitively connect to a
- >> newline-delimited list of devices.  In other words, if I have
- >> device1, device2 and device3 then what I want is:
- >>
- >> telnet device1
- >> telnet device2
- >> telnet device3
- >>
- > xargs -n1 telnet <<HERE
- > device1
- > device2
- > device3
- > ...
- > deviceN
- > HERE

--
Eric Schnoebelen		eric at cirr.com 		http://www.cirr.com
      "Memory is like an orgasm. It's a lot better if you don't
	  have to fake it." -Seymore Cray, on virtual memory



More information about the Discuss mailing list