请会写windows批处理文件和shell脚本的大神帮忙将这个shell脚本转换成批处理文件

#!/bin/sh#onepara.clean_flag=0#makecleanecho"输入参数:$*"whilegetopts"C"argdocase$arginC)... #!/bin/sh

# one para.

clean_flag=0 # make clean

echo "输入参数: $*"

while getopts "C" arg
do
case $arg in
C)
echo "arg: C"
clean_flag=1
;;
esac
done

if [ $# -eq 1 ] ; then
if [ $clean_flag == 1 ]; then
echo "clean tools..."
rm -rf translateTools/*
else
echo "Input param error!"
fi

echo "<<<<Exit!>>>>"
exit 1;
fi

# two para.
if [ $# != 3 ] ; then
echo " Error: Input parameter is incorrect!"
exit 1;
fi

TS_DIR=$(pwd)/qt_ts
CUR_TS_FILE=${TS_DIR}/qt_ts.ts

if test -d ${TS_DIR}
then
echo " Dir is yes"
else
mkdir ${TS_DIR}
fi

if [ -f $CUR_TS_FILE ]
then
rm $CUR_TS_FILE
fi

if [ -f $1 ]
then
lupdate $1 -ts $CUR_TS_FILE
else
echo " The file:$1 isn't exist which you input, exit!"
exit 1
fi

sync

echo " pwd:$(pwd)"
XLS_DIR=$(pwd)/language
CUR_XLS_FILE=${XLS_DIR}/res_language_translate_120.xls

translateTools/iMac120Translate_win.exe $CUR_XLS_FILE $CUR_TS_FILE $XLS_DIR/res_language_translate_120.ts $3

lrelease $XLS_DIR/res_language_translate_120.ts
#sleep 1
#cp ${CUR_TS_FILE} ${TS_DIR}/qt_ts_check.ts
#rm ${CUR_TS_FILE}
#rm ${TS_DIR} -rf
#rm $XLS_DIR/res_language_translate_120.ts
echo " Output qm file: [ $2 ]"
mv $XLS_DIR/res_language_translate_120.qm $XLS_DIR/$2

echo " copy to local..."
mkdir $(dirname $1)/language
cp $XLS_DIR/$2 $(dirname $1)/language/
echo " <<<<End qm output>>>>"
自己摸索着写了一大半,不麻烦大家帮忙全部转换了。现在问题有所改变,

if exist %1(
......
) else (
echo The file:"%1" isn't exist which you input, exit!
)
其中“%1”是我用命令行传入的一个文件路径
这句用bat怎么写,为什么我老是提示“命令语法不正确”?
如果改成if exist“%1”,则输出The file:"" isn't exist which you input, exit,%1显示,求正确写法
展开
 我来答
风竹郎
2016-12-01
知道答主
回答量:23
采纳率:0%
帮助的人:5.3万
展开全部
set /p CUR_PRO_FILE=请输入工程路径:
echo 工程路径:%CUR_PRO_FILE%
if exist %CUR_PRO_FILE% (
lupdate %CUR_PRO_FILE% -ts %CUR_TS_FILE%
) else (
echo 文件%CUR_PRO_FILE%不存在!
)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式