以下按預期工作。但是,如何將數據插入第四個數據庫而不是命令提示符中的默認「0」?在redis命令提示符下使用不同的數據庫
# echo -n "testing" | /home/shantanu/redis-2.4.2/src/redis-cli -x set my_pass
OK
# echo -n "testing" | /home/shantanu/redis-2.4.2/src/redis-cli -x select 4; set my_pass
(error) ERR wrong number of arguments for 'select' command
重要的是要注意,redis-cli不允許多個命令。 – seppo0010