I'm working on a bash script for another question I'm asking. Here's what I have:
exec 3<>/dev/tcp/m.m.0001.u.cache.amazonaws.com/11211
echo -e "get CacheCleaner\nquit" >&3
cat <&3
It works, almost. It returns this:
VALUE CacheCleaner 0 1
1
END
What I don't have the stills to do, is take the 1 on the middle line, and put it into a variable.
I tried editing the >&3, and I have some idea what that does, but I'm a bit lost.
Based on How to store standard error in a variable in a Bash script
It looks like I can do:
exec 3<>/dev/tcp/m.m.0001.u.cache.amazonaws.com/11211
echo -e "get CacheCleaner\nquit" >&3
CC=`cat <&3`
echo $CC
This returns:
ENDE CacheCleaner 0 1
So not really what I need, but closer.