Last active
December 18, 2015 23:49
-
-
Save pataiji/5864246 to your computer and use it in GitHub Desktop.
bzip2のalias的なfunction。
引数にファイルなりディレクトリを渡す。
あまりできは良くない。
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
function bz { | |
if [ -n "$1" -a -e "$1" ]; then | |
if [ -d "$1" ]; then | |
filename=`echo $1 | sed -e "s/\/$//"` | |
tar jcf "${filename}.tar.bz2" "$1" | |
else | |
bzip2 -zk -9 "$1" | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment