#!/bin/bash URL="https://www.openldap.org/software/download/" # Get version number from tag name VERSION=$(curl -s -L "$URL" | grep -o -E 'OpenLDAP-[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}') # Trim prefix VERSION=${VERSION//OpenLDAP-/} echo "$VERSION"