清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
#!/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