Skip to content

Instantly share code, notes, and snippets.

@benwei
Created September 17, 2018 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwei/148720a0bab301ad57ec3512d007fc1e to your computer and use it in GitHub Desktop.
Save benwei/148720a0bab301ad57ec3512d007fc1e to your computer and use it in GitHub Desktop.
using multipe keys and arguments with lua script via redis-cli
-- 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
$ 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