On Tue, Jul 23, 2013 at 09:46:38PM -0700, Kirk Chang wrote:
> Hi,
>
> I use telnet to connect to redis , but I found out that cannot set value
> with space in it , please help.
>
> Thanks alot.
>
> Xshell:\> telnet 192.168.11.100 6379
>
>
> Connecting to 192.168.11.100:6379...
> Connection established.
> To escape to local shell, press 'Ctrl+Alt+]'.
> set key 123456
> +OK
> set key helloworld
> +OK
> set key hello world
> -ERR syntax error
> *set key "hello world"*
> *-ERR syntax error*
> set key 'hello world'
> -ERR syntax error
> *set key \"hello world\"*
> *-ERR syntax error*
> set key \'hello world\'
> -ERR syntax error
>
If you want to do this via telnet you need to use the binary-safe
unified protocol as described in
http://redis.io/topics/protocol (which
is of course a little hassle to type on an interactive telnet session)
Otherwise use redis-cli or another client library.