Created
September 17, 2018 09:43
-
-
Save benwei/148720a0bab301ad57ec3512d007fc1e to your computer and use it in GitHub Desktop.
using multipe keys and arguments with lua script via redis-cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- redis-cli --eval hello.lua Tester " devops" , Argument1 " argument2" | |
-- KEYS[1] == "Tester" | |
-- KEYS[2] == " devops" | |
-- ARGV[1] == "Argument1" | |
-- ARGV[2] == " argument2" | |
local msg = "Hello, world," .. KEYS[1] .. KEYS[2] .. "!" .. ARGV[1] .. ARGV[2] | |
return msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ redis-cli --eval hello.lua Tester " devops" , Argument1 " argument2" | |
"Hello, world,Tester devops!Argument1 argument2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment