我的脚本在Bash中抛出错误:
COUNT= $(ls -1 | wc -l)
echo $COUNT
for (( i=1 ; i <= $COUNT ; i++ ));
do
var=package$i.xml
echo "FILENAME is $var"
mv -f $var package.xml
mkdir ${WORKSPACE}/Deploy/unpackaged
cp -R ${WORKSPACE}/tools/Package/package.xml ${WORKSPACE}/Deploy/unpackaged/
cd ${WORKSPACE}/Deploy/unpackaged
cat package.xml
ls -ltra
cd ${WORKSPACE}/Deploy/
ls -ltr
ant -buildfile build.xml RetrieveComponent
done
这是脚本:
[DllImport]
为什么脚本会导致错误?
答案 0 :(得分:2)
我相信罪魁祸首是你的COUNT
变量将其更改为:
COUNT=$(ls -1 | wc -l)
好像=
和$
之间有空格。请检查并告诉我们当时的情况。
答案 1 :(得分:-1)