Redis multi insert issue

2019-07-21 21:10发布

问题:

I try to multi-insert but it gives me error - http://pastie.org/7337421

$ cat mass_insert.txt 
*3\r\n$3\r\nSET\r\n$3\r\nkey\r\n$5\r\nvalue\r\n
$ cat mass_insert.txt | redis-cli --pipe
All data transferred. Waiting for the last reply...
ERR Protocol error: invalid multibulk length

What am I doing wrong ?

回答1:

Can you try the following:
echo -e "$(cat mass_insert.txt)" | redis-cli --pipe