I'm trying to run a couple remote commands on a box that will not give me a normal shell (it's a device with a proprietary shell).
I'm also running the command from a device with a limited set of resources so I can't add something like Expect.
I tried the following to no avail:
#!/bin/ksh
( sleep 2
echo username
sleep 5
echo password
sleep 5
echo show whoison ) | telnet 192.168.1.10
It successfully enters the username and fails on entering the password. "\n" didn't seem to work either.
I've tried SSH before but the shell that the device is using wouldn't let me pass commands (I tried ssh user@host 'show whoison')