From b04bed1ef49e0a128a89687b5b88c8bee40ff18f Mon Sep 17 00:00:00 2001 From: Ryan Jacobs Date: Sat, 27 Dec 2014 16:12:54 -0800 Subject: [PATCH] Catch "no reply" error. If $REPLY == 0, then there was *no* reply. --- redis-bash-lib | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/redis-bash-lib b/redis-bash-lib index 235c4ac..05a169b 100755 --- a/redis-bash-lib +++ b/redis-bash-lib @@ -23,6 +23,12 @@ function redis-client() { fi local ARGV read -r -u ${FD} + + if [ ${#REPLY} -eq 0 ]; then + printf "error: no reply\n" + exit 1 + fi + REPLY=${REPLY:0:${#REPLY}-1} case ${REPLY} in -*|\$-*) # error message