如果值包含多行,如何设置为redis值?

How to set to redis value if the value contain multiline?

我无法为 Redis 设置多行值?有什么更好的办法吗?

我找到了答案。

喜欢就好

printf "*3\r\n$3\r\nset\r\n$3\r\nfoo\r\n$15\r\nMyGroup\r\nGroupA\r\n" | nc localhost 6379

* 指定行数 \$ 数字符