tarcount=$1islua=`echo *_virdir`echo =$islua=if [[ $islua != "*_virdir" ]]; then if [ -d ../zipluadir ]; then rm -rf ../zipluadir fi mkdir ../zipluadir # echo count==$tarcount= for (( i = 1; i <= $tarcount; i++ )); do echo i=$i if [ -d $i ]; then if [ -d $i_virdir ]; then zip -qr ../zipluadir/game$i.zip ./$i fi fi doneelse if [ -d ../ziph5dir ]; then rm -rf ../ziph5dir fi mkdir ../ziph5dir for (( i = 1; i <= $tarcount; i++ )); do #statements if [ -d $i ]; then zip -r ../ziph5dir/game$i.zip ./$i fi donefi
使用 cd workpath
./zipshell 4