function gztar()
{
[ -d "$1" ] || { echo "usage: gztar <dir> [tar options]" 1>&2; exit 1; }
- DIR="$1"
+ local DIR="$1"
shift
tar "$@" -czvf "$(basename "$DIR").tar.gz" "$DIR"
}
function bztar()
{
[ -d "$1" ] || { echo "usage: bztar <dir> [tar options]" 1>&2; exit 1; }
- DIR="$1"
+ local DIR="$1"
shift
tar "$@" -cjvf "$(basename "$DIR").tar.bz2" "$DIR"
}
function xztar()
{
[ -d "$1" ] || { echo "usage: xztar <dir> [tar options]" 1>&2; exit 1; }
- DIR="$1"
+ local DIR="$1"
shift
tar "$@" -cJvf "$(basename "$DIR").tar.xz" "$DIR"
}