Skip to content

Instantly share code, notes, and snippets.

@criztovyl
Last active February 9, 2016 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save criztovyl/f579096ddba239522fba to your computer and use it in GitHub Desktop.
Save criztovyl/f579096ddba239522fba to your computer and use it in GitHub Desktop.
Downloads, extracts and removes a archive file.
# 2016 Christoph "criztovyl" Schulz
# No Copyright, too trivial.
dlextract() {
file=$1
command=$2
keep=$3
wget $file && $command `basename $_` && [ "$keep" ] || rm -f $_
}
dlunzip(){ dlextract "$1" "7z x" $2; }
dluntar(){ dlextract "$1" "tar -xaf" $2; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment