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
#==============================================================================
if [ $1 = "-c" ]; then
echo "cleaning..."
cd tars
for file in *.tar; do
ZIP="${file%%.tar*}.zip"
echo "check \"$ZIP\" ..."
if [ -f "../$ZIP" ];then
echo "delete $ZIP ..."
rm -i "../$ZIP"
else
echo "$ZIP not exist."
fi
done
cd ..
rm -ri tars
exit 0
if [ $1 = "-c" ]; then
echo "cleaning..."
if [ $2 = "-i" ]; then
PARAM = "-i"
fi
cd tars
for file in *.tar; do
ZIP="${file%%.tar*}.zip"
echo "check \"$ZIP\" ..."
if [ -f "../$ZIP" ];then
echo "delete $ZIP ..."
rm $PARAM "../$ZIP"
else
echo "$ZIP not exist."
fi
done
cd ..
rm -r $PARAM tars
exit 0
fi
check_sub(){