Created
January 11, 2012 01:58
-
-
Save killerswan/1592501 to your computer and use it in GitHub Desktop.
use unar to extract ZIP files on MacOS sensibly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Kevin Cantu, January 2012 | |
me="$(basename "$0")" | |
function uzi () { | |
if [ ! -r "$1" ] | |
then | |
echo "${me}: \"$1\" is not a readable file" > /dev/stderr | |
return | |
fi | |
# whacks the resource fork by expanding it to other directories | |
# unzip -d "${1}-expanded" "$1" | |
# can't have the output folder named? | |
# open -a "Archive Utility" "$1" | |
# unar beta 0.2 from http://code.google.com/p/theunarchiver/ | |
# unar -forks fork "$1" "${1}-expanded" | |
# | |
# unar 0.99 | |
unar -forks fork -o "${1}-expanded" "$1" | |
} | |
for x in $* | |
do | |
uzi "$x" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment