post image March 4, 2024 | 1 min Read

Oneliner to compare software versions

export _tags=$(git tag --list  | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
export _current=$(curl -s  https://api.github.com/repos/hashicorp/vault/releases | jq -r '[.[] | select(.prerelease != true) | .name ] | first' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
[[ $_tags =~ $_current ]] && echo "match" || echo "no match"

202403041403

author image

Jan Toth

I have been in DevOps related jobs for past 6 years dealing mainly with Kubernetes in AWS and on-premise as well. I spent quite a lot …

comments powered by Disqus