Update z2t.sh

This commit is contained in:
tianyu 2014-10-31 21:34:23 +08:00
parent a8f9156b67
commit 0e4f928ad9
1 changed files with 19 additions and 16 deletions

35
z2t.sh
View File

@ -8,22 +8,25 @@
#bash_version :4.3.11(1)-release #bash_version :4.3.11(1)-release
#============================================================================== #==============================================================================
if [ $1 = "-c" ]; then if [ $1 = "-c" ]; then
echo "cleaning..." echo "cleaning..."
cd tars if [ $2 = "-i" ]; then
for file in *.tar; do PARAM = "-i"
ZIP="${file%%.tar*}.zip" fi
echo "check \"$ZIP\" ..." cd tars
if [ -f "../$ZIP" ];then for file in *.tar; do
echo "delete $ZIP ..." ZIP="${file%%.tar*}.zip"
rm -i "../$ZIP" echo "check \"$ZIP\" ..."
else if [ -f "../$ZIP" ];then
echo "$ZIP not exist." echo "delete $ZIP ..."
fi rm $PARAM "../$ZIP"
done else
cd .. echo "$ZIP not exist."
rm -ri tars fi
exit 0 done
cd ..
rm -r $PARAM tars
exit 0
fi fi
check_sub(){ check_sub(){