2
votes

I have a simple LUA script that looks like:

local msg = "Hello, world! " .. tostring(ARGV[1])
return msg

I am on Windows and I call this script with redis-cli --eval hello.lua 0, "USA"

But I always get "Hello, world! nil"

How should I pass an argument to this test script?

1
If the Windows port is like the official branch, you'll need a space before and after the comma, i.e. redis-cli --eval hello.lua , USA (note that you do not need to specify the number of keys as everything before the comma is considered as such) - Itamar Haber
@ItamarHaber, make it the answer ;) - Paul Kulchenko
Only if the behavior is the same - I never tried the Windows fork - Itamar Haber
Works!! Thank you - Kevin Burton
@KevinBurton cool - made it into an answer - Itamar Haber

1 Answers

3
votes

If the Windows port is like the official branch, you'll need a space before and after the comma, i.e.:

redis-cli --eval hello.lua , USA 

(note that you do not need to specify the number of keys as everything before the comma is considered as such)