shell更新jar包内容

2015-02-02 0 925
shell更新jar包内容
#!/bin/sh

WORK_HOME=`pwd`
filesPath=$WORK_HOME"/files"

#判断files目录是否存在,如果不存在提示并退出程序
if [ ! -d "$filesPath" ]; then
    echo "不存在目录:$filesPath";
    exit 0;
else
    echo "成功找到目录:$filesPath";
fi

#判断files目录是否为空
fileCount=`ls $filesPath | wc -l`
echo "files目录内文件数量:$fileCount"
if [ ! "$fileCount" -gt "0" ]; then
	echo "files目录是空的,没有要更新的内容,退出"
	exit 0;
fi

echo "==========================================="

jarlist=`find *.jar`
for jarName in $jarlist
do
	echo "开始处理:" $jarName

	cp $jarName files
	cd files
	jar uvf $jarName *
	mv $jarName ../
	cd $WORK_HOME

	echo "==========================================="
done

遇见资源网 shell shell更新jar包内容 http://www.ox520.com/16826.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务