Skip to content

Instantly share code, notes, and snippets.

View HappyZ's full-sized avatar
🤔
thinking

HappyZ HappyZ

🤔
thinking
View GitHub Profile
#!/usr/bin/env bash
#set -x
function extract() {
if [ -f "$1" ] ; then
case "$1" in
*.tar.bz2) tar xvjf "$1" ;;
*.tar.gz) tar xvzf "$1" ;;
*.tar.xz) tar xvf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.rar) unrar x "$1" ;;