Skip to content

Instantly share code, notes, and snippets.

@arne-cl
Created July 11, 2014 08:11
Show Gist options
  • Save arne-cl/088df47e3f1624d008b3 to your computer and use it in GitHub Desktop.
Save arne-cl/088df47e3f1624d008b3 to your computer and use it in GitHub Desktop.
dowload a compressed file, unpack it, cd into the directory and list its content
#!/usr/bin/env bash
url="$1"
wget -q "$url"
tarfile=${url##*/} # strip off the part before the last slash
dtrx "$tarfile"
dir=${tarfile%%.*} # strip off everything after the first dot
cd "$dir"
ls
# TODO: stay in $dir after the script ends
# TODO: handle dtrx interaction
@arne-cl
Copy link
Author

arne-cl commented Jul 22, 2014

dtrx was written in Python, so we could turn this into a proper script!

http://brettcsmith.org/2007/dtrx/
hg clone http://www.brettcsmith.org/2007/dtrx/dtrx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment