I have the "Hello World" program in Lua script. I am trying to call the script from (Chocolatey) Redis client. I keep getting this error (error) ERR Error compiling script (new function): user_script:1: function argument expected near '.'
Redis Script: "hello.lua"
local msg = "Hello, world!"
return msg
Chocolatey Redis Client:
127.0.0.1:6379> EVAL "D:\hello.lua" 0
Error Message
(error) ERR Error compiling script (new function): user_script:1: function argument expected near '.'
EVAL
accepts the script itself, not a filename.Try this:
EDIT: to execute a script in a file,
redis-cli
provides the--eval
switch that you can use as follows:I'm not familiar with the Windows fork, but it should be supported by it as well in all likelihood.
In *nix, you can also use the shell to provide the contents of the script to the cli, for example:
will load the contents in the file to Redis. There should be a similar way for achieving this in Windows but that's outside my current scope ;)