Skip to content

Instantly share code, notes, and snippets.

@pataiji
Last active December 18, 2015 23:49
Show Gist options
  • Save pataiji/5864246 to your computer and use it in GitHub Desktop.
Save pataiji/5864246 to your computer and use it in GitHub Desktop.
bzip2のalias的なfunction。 引数にファイルなりディレクトリを渡す。 あまりできは良くない。
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