telnet redis but cannot set value with space

549 views
Skip to first unread message

Kirk Chang

unread,
Jul 24, 2013, 12:46:38 AM7/24/13
to redi...@googlegroups.com
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

Salvatore Sanfilippo

unread,
Jul 24, 2013, 4:39:37 AM7/24/13
to Redis DB
Hello,

the "inline" protocol is just menat to be used in emergencies to run a few commands, but I agree, it's lame you can't quote strings, so I just fixed it in the 2.8 and unstable branch.

Cheers,
Salvatore


--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Salvatore 'antirez' Sanfilippo
open source developer - GoPivotal
http://invece.org

Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defence against complexity.
       — David Gelernter

Jan-Erik Rediger

unread,
Jul 24, 2013, 4:39:55 AM7/24/13
to redi...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages