Skip to content

Instantly share code, notes, and snippets.

@smj10j
Last active August 12, 2016 04:52
Show Gist options
  • Select an option

  • Save smj10j/b4e6a17a484eb3cba2c7 to your computer and use it in GitHub Desktop.

Select an option

Save smj10j/b4e6a17a484eb3cba2c7 to your computer and use it in GitHub Desktop.
Quick exraction speed test for archive applications on OSX
#!/bin/bash
########################################
# Tests zip capabilities of given apps #
########################################
if [[ "$#" == 0 ]]; then
echo "Usage: $0 [directory] [apps...]"
exit 1
fi
DIR=$(readlink -e "${1:-~/Downloads/}")
if [[ ! -d "$DIR" ]]; then
echo "Invalid directory '$1'"
exit 1
else
shift
APPS=( ${@:-'Archive Utility' 'BetterZip' 'The Unarchiver'} )
fi
echo "Using dir $DIR"
echo "Testing apps ${APPS[@]}"
echo ""
for APP in "${APPS[@]}"; do
echo "Testing $APP..."
time open --wait-apps --background -a "$APP" --args "$DIR"/*.zip
find "$DIR"/* -maxdepth 0 -type d -exec rm -rf {} \; 2>/dev/null
echo ""
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment