Grab the ErrorType and Sort from an errors output nl errors.txt | grep -E '\d+\s?\w+Error' | sort -k2 Grab the latest numeric increment from a tag (change the substr value) git tag | grep victoryhawk | awk '{print substr($1,12); }' | sort -n | tail -1