Skip to content

Instantly share code, notes, and snippets.

@junmakii
Created May 25, 2015 14:44
Show Gist options
  • Select an option

  • Save junmakii/2cea73426e017e14d112 to your computer and use it in GitHub Desktop.

Select an option

Save junmakii/2cea73426e017e14d112 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
usage() {
cat <<EOF
${0} <directory> <output>
EOF
}
if [[ $# -lt 2 ]]; then
usage
exit 1
fi
output=${2}/$(basename $1).tar.gz
tar -czvf ${output} -C ${1} .
echo ${output}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment