Loading...
This site is best viewed in a modern browser with JavaScript enabled.
Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.
openresty 下执行 print("测试下:"..os.execute("which gm 1>/tmp/aaaa 2>/tmp/aaaa")) 得不到期望的输出值0,Mac下输出256
louis.zhou.cn
openresty 运行在Mac下 lua 文件中执行 print("测试下:"..os.execute("which gm 1>/tmp/aaaa 2>/tmp/aaaa")) 返回的是256,
期望的结果并未写入文件“/tmp/aaaa”中;单独在luajit解释器中执行不存在该问题,代码部署在Linux下运行也不存在。命令换成其他命令如os.execute("type gm 1>/tmp/aaaa 2>/tmp/aaaa") 输出也不存在这个问题。不知是啥原因?