#!/bin/bash clear echo " ---------------------------- | * Finder Style Archiver * | ---------------------------- This script creates or expands archives like the ones made by Finder using the ditto command. WHAT WOULD YOU LIKE TO DO TODAY? Archive (A) or Expand (E)" read operation if [ $operation = a -o $operation = A ] then ## ARCHIVE ROUTINE ## echo " Please locate the FILE or DIRECTORY to archive..." read archiveSrc echo " Please type a NAME for the archive..." read archiveName echo " Creating archive... Please wait... " sudo ditto -c -k -rsrc "$archiveSrc" ~/Desktop/"$archiveName".zip echo " Your archive has been successfully created! Whoopee! " open ~/Desktop exit else if [ $operation = e -o $operation = E ] then ## EXPAND ROUTINE ## echo " Please locate the FILE or DIRECTORY to unzip..." read zipFile echo " Please choose a DESTINATION for the unzipped files..." read zipDest echo " Expanding archive... Please wait... " sudo ditto -x -k -rsrc "$zipFile" "$zipDest" echo " Your archive has been successfully expanded! Whoopee! " open "$zipDest" exit else echo " Look pal, choose from the available options. Quitting now... Bye... " exit fi fi exit 0