2
votes

Within my Redis cache I've run

SET 12345 JoeDude
SET JoeDude "It works!!"

I've a Lua script that is intended to be run from the terminal:

lua
local user=redis.call('GET', KEYS[1])
local output=redis.call('GET', user)
return output

At the terminal I run redis-cli --eval lua_R_and_D.lua 12345

I then receive the following error: (error) ERR Error compiling script (new function): user_script:2: '=' expected near 'local'

What, pray tell, am I doing wrong?

1
You have the word lua before your first actual statement. Maybe comment that out? - luther
That was it! I had seen various web pages that started with "lua", but when running this now it returns the data as expected. - JSBach

1 Answers

1
votes

Comment out lua as in: --lua Not too familiar with lua as a language but apparently it is good for server side scripting and -- is the comment for the lua language.