Pass key which name contains blank to redis using bash failed

Viewed 21

For example, i have a key list in file named keys, and some key name contains blank:

keya
keyb
"a blank key"

I want to get values from redis in bash, so my command is:

while read key ;do redis-cli -h 127.0.0.1 get $key;done < keys

But when the name contains blank, the comand executes failed:

none
none
(error) ERR wrong number of arguments for 'type' command

Does anynoe knows how to fix this? Thanks very much.

0 Answers
Related