Trying to download latest SBT version from GitHub:
version="$(curl -vsLk https://github.com/sbt/sbt/releases/latest 2>&1 | grep "< Location" | rev | cut -d'/' -f1 | rev)"
version
is set to v1.1.0-RC2
Then attempting to download the .tar.gz package:
curl -fsSLk "https://github.com/sbt/sbt/archive/${version}.tar.gz" | tar xvfz - -C /home/myuser
However, instead of the correct URL:
https://github.com/sbt/sbt/archive/v1.1.0-RC2.tar.gz
Somehow the version string is interpreted as a command(?!), resulting in:
.tar.gzttps://github.com/sbt/sbt/archive/v1.1.0-RC2
When I manually set version="v1.1.0-RC2"
, this doesn't happen.
Thanks in advance!