【问题标题】:Batch file: program output in different folder批处理文件:不同文件夹中的程序输出
【发布时间】:2014-08-02 03:15:24
【问题描述】:

所以我使用 luac 将一些 .lua 通过批处理文件递归地编译成 .lub

我还遇到一个问题,即 luac(与 .lua 同名,但扩展名为 .lub)不会进入找到 .lua 的文件夹。

我用过:

for /r %%r in (*.lua) do luac5.1.4.exe -o "%%~nr.lub" "%%r"

更深的文件夹中的.lua.lub在根文件夹中输出。

我应该在脚本中进行哪些更改以使其在.lua 的位置文件夹中输出?

【问题讨论】:

    标签: batch-file lua batch-processing luac


    【解决方案1】:

    我解决了这种情况,只是改变了脚本的结尾。现在看起来像这样:

    for /r %%r in (*.lua) do "luac5.1.4.exe" -o "%%~pnr.lub" "%%r"
    

    现在批处理会输出到%%~pnr,它作为文件名和路径,不包括扩展名,所以我可以在最后添加.lua,解决这个小问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-17
      • 1970-01-01
      • 1970-01-01
      • 2013-08-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多