nosql - Redis种如何执行lua文件
高洛峰
高洛峰 2017-04-24 09:10:35
0
2
1039

我看到的所有教程都是用eval 指令后面接一段lua脚本,我尝试eval <lua文件> <参数>时,例如:eval hello.lua 0
提示
“ ERR Error compiling script (new function): user_script:1: '=' expected near 'end'”
即使我的hello.lua文件中只有一句 return "hello world"

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
巴扎黑

Excuse my ignorance. Isn't Redis used for caching? Can it still be used to run scripts?
In addition, the error message said that the end of the statement should be = sign

Peter_Zhu

You should use --eval instead of eval when executing

And please note that the eval command was only added to redis starting from version 2.6.0

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template