lines=""
for (( i=0; i < $lineNum; i++ )); do
read -t 1 -u $redis_socket line
lines+=$line
done
echo "$lines"
for example, suppose each line from socket is aaa
, bbbb
, ccccc
I want final output to be like aaabbbbccccc
.
but I got aaabc
, am I doing something wrong here?
I did try many alternatives in other questions but nothing really works.
sample output lines are like below
redis_version:3.0.7
redis_git_sha1:00000000
redis_git_dirty:0
slave0:ip=127.0.0.1,port=6379,state=online,offset=549974442474,lag=0
....
db1:keys=4190,expires=0,avg_ttl=0
and the final output is
db1:keys=4190,expires=0,avg_ttl=0tl=1200913396e,offset=549974442474,lag=0