telnet redis bash script

Matt

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,

Chair

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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related