Created
January 4, 2011 02:09
-
-
Save mtigas/764291 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Wraps the standard tar command with the xz (LZMA2) | |
# compression program since Mac OS X's old version of `tar` | |
# doesn't have the -I shortcut flag. | |
# | |
# Requires XZ Utils. | |
# | |
# On Mac OS X with homebrew, you can get XZ Utils via: | |
# brew install xz | |
/usr/bin/tar --use-compress-program=xz_wrap.sh $@ | |
# ALTERNATIVE: | |
# If you don't care about customizing the compression | |
# level & RAM use, you can just call xz with the defaults | |
# and skip the wrapper script below. | |
# | |
# /usr/bin/tar --use-compress-program=xz $@ |
This file contains 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 | |
# xz wrapper script for compatibility with tar. | |
# | |
# Wraps a data stream through xz (LZMA2) compression or | |
# decompression (if the -d flag is set) with some customizations. | |
# | |
# Feel free to adjust the xz settings (currently uses -3) | |
# depending on the system this script is deployed on. | |
case $1 in | |
-d) xz -qdvc ;; | |
'') xz -qzvc -3 ;; | |
*) echo "Unknown option $1">&2; exit 1;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment