#!/bin/bash #This shellscript is named makezip. #It creates a .zip file that holds the Xcode project #named as the command line argument. if [[ $# -ne 1 ]] then echo $0: requires exactly 1 command line argument 1>&2 exit 1 fi if [[ ! -e $1 ]] then echo $0: $1 does not exist 1>&2 exit 2 fi if [[ ! -d $1 ]] then echo $0: $1 is not a directory 1>&2 exit 3 fi if [[ ! -r $1 ]] then echo $0: no permission to read $1 1>&2 exit 4 fi if [[ -e $1.zip ]] then echo $0: $1.zip already exists and I will not overwrite it 1>&2 exit 5 fi zip -qr $1.zip $1 -x $1'/build/*' chmod 444 $1.zip #r--r--r-- ls -l $1.zip exit 0