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://go.dev | |
#get source code of download page | |
echo "Starting Go installation" | |
curl -o $HOME/temp.txt $url/dl/ | |
#retrieve the first link for linux amd64 (recommended download) | |
grepmatch=$( cat $HOME/temp.txt | grep -E '\/dl\/.*linux.*amd64.tar.gz' | head -1) | |
echo $( echo $grepmatch | sed 's/^.*\(\/dl\/.*tar\.gz\).*$/\1/') > $HOME/temp.txt |