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

7
z2t.sh
View File

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