#!/bin/bash URL="https://archive.mozilla.org/pub/nspr/releases/" # Get version number from tag name VERSION=$(curl -s -L "$URL" | grep -o -E 'v[0-9]{1,}.[0-9]{1,}(.[0-9]{1,})?' | sort -V | tail -n1) # Trim 'v' character in VERSION variable VERSION=$(echo "$VERSION" | tr -d 'v') echo "$VERSION"