我只想列出我的 *.lua 文件并将其 luac 到 *.ttt
我的 buildData.sh 像这样
findLua()
{
for file in $(find $PWD -name "*.lua")
do
local dirname=$(dirname "$file")
local filename=$(basename "$file")
local fuName=$dirname"/"${filename%.*}
local outPath = $fuName | sed "s/.*Lua\/\(.*\)/\1/"
echo $fuName | sed "s/.*Lua\/\(.*\)/\1/" #echo the absolute path is right
echo $outPath #the echo nothing why?
$LUACTOOL -o $TEMPDIR$outPath.ttt $file
echo out$TEMPDIR$outPath.ttt
done
}
这一行:
local outPath = $fuName | sed "s/.*Lua\/\(.*\)/\1/"
得到了null但我回 显 $fuName | sed "s/. Lua/(. )/\1/"打印是对的,为什么会这样?任何人都可以帮助我吗?