2015-10-29 30 views
-2

我剛開始學習的Lua,並使用Programming in Lua作爲教程的Lua入門

但現在我有問題,在第1.4節,當我輸入

> lua -e "sin=math.sin" script a b

然後東西出問題

lua: cannot open script: No such file or directory

有人可以給我關於它的想法嗎?謝謝:)

P.S.我使用Mac OSX 10.10.5作爲環境,並且Lua版本是Lua 5.2.4 Copyright (C) 1994-2015 Lua.org, PUC-Rio

+0

有一個叫做'script'文件? –

+0

哦,我明白了!我誤解了腳本是一個指令 –

+0

非常感謝! :) –

回答

0

我得到了答案,這要感謝於皓。

script是LUA文件,而不是指令

我認爲這是更好地理解:

> lua -i -e "sin=math.sin" a.lua a b