Created
July 6, 2017 05:47
-
-
Save abhinavkorpal/bad6bded5b3b265566e17cd39d16407f to your computer and use it in GitHub Desktop.
Compress Script
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/sh | |
# sed -e 's/^[ \t]*//;s/[ \t]*$//' -e '/^#/d' -e '/^$/d' | |
if [ -z $1 ]; then exit 0; else true; fi | |
xz -kf9 $1 | |
printf '#!/bin/sh\nx=`tempfile`;echo ' > ${1}-min | |
base64 -w 0 ${1}.xz >> ${1}-min | |
printf '|base64 -d|xz -d>$x && chmod +x $x && $x $@; rm $x' >> ${1}-min | |
rm -f ${1}.xz | |
chmod a+x ${1}-min |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment