1

I am not able to set multiline value to redis? is there any better way to do?

Oktaheta
  • 606
  • 5
  • 21
  • 1
    What have you tried? Can you share an example? Are you using the CLI? If so, are you passing the command from the command line or are you typing it in REPL mode? – Itamar Haber Sep 26 '18 at 12:29
  • I am using nc. Trying to escape \r\n. – Oktaheta Sep 26 '18 at 16:04
  • I'm not sure what you mean - perhaps you can add the actual thing you're trying to do to the question itself? In any case, I don't see why you'd need to escape that, e.g. `printf "*2\r\n\$4\r\nPING\r\n\$4\r\nYO\r\n\r\n" | nc localhost 6379` works for me. – Itamar Haber Sep 26 '18 at 19:51
  • Something like this is not working. printf `"*1\r\n\$35set key MyGroup\r\nGroupA\r\nGroupB\r\n" | nc localhost 6379` – Oktaheta Sep 26 '18 at 22:48

1 Answers1

1

I found the answer.

Just do like

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

* Specify the rows \$ count the character

Oktaheta
  • 606
  • 5
  • 21