#!/bin/bash # Sourceforge project REPO="hdparm" # Get version using best_release.json VERSION=$(curl -s -L https://sourceforge.net/projects/"$REPO"/best_release.json | jq -r '.platform_releases.linux.filename' | cut -d'/' -f3) # Trim prefix VERSION=${VERSION//hdparm-} # Trim suffix VERSION=${VERSION//.tar.gz} echo "$VERSION"