shantanuo
shantanuo

Reputation: 32316

Pipe data to redis

When I pipe the echo to redis client, I get an error.

[root@server ~]$ echo "abc43345" | redis-cli set my_passwd2
(error) ERR wrong number of arguments for 'set' command

But the following works as expected.

[root@server ~]$ redis-cli set my_passwd2 `echo "abc43345"`
OK

Is there any way to make the first example work?

Upvotes: 5

Views: 4073

Answers (1)

seppo0010
seppo0010

Reputation: 15849

It can actually be achieved using "-x" flag

echo "abc43345" | redis-cli -x set my_passwd2

Upvotes: 12

Related Questions