#!/bin/bash # Git repository REPO="git://w1.fi/hostap.git" # Get tag name using 'git ls-remote' TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | tail -1 | cut -d'/' -f3) # Trim 'hostap_' prefix from TAG_NAME variable VERSION=$(echo "$TAG_NAME" | sed 's/hostap_//g') # Replace underscores with dots in VERSION variable VERSION=$(echo "$VERSION" | tr '_' '.') echo "$VERSION"