How can I extract the output from a telnet command on a remote redis-server in a bash script.
I would do:
telnet remote-redis-ip 6379
LRANGE mylist 0 -1
And save the result in a variable. How can I reach this goal under a bash script?
Thanks,
try this
RET=`telnet remote-redis-ip 6379 << EOF
LRANGE mylist 0 -1
EOF`
echo $RET
and I think using expect automating telnet session using bash scripts post by fedorqui will be better
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