Last active
February 8, 2019 14:59
-
-
Save mikybars/25a85b5360481576dac26017c085ecad to your computer and use it in GitHub Desktop.
Nice one-liner when you want to extract a file from a tarball hosted somewhere but you don't want to deal with temporary files. File is copied to the target directory with path stripped.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ URL="https://github.com/sharkdp/bat/releases/download/v0.9.0/bat-v0.9.0-x86_64-unknown-linux-musl.tar.gz" | |
$ TARPATH="$(basename $URL .tar.gz)/bat" | |
$ TO=~/bin | |
$ curl -fsSL $URL | tar xzf - -C $TO --transform="s,$(dirname $TARPATH)/,," $TARPATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment