Skip to content

Instantly share code, notes, and snippets.

View NickMoignard's full-sized avatar

Nick NickMoignard

  • Moignard Digital Solutions
  • Melbourne, Australia
View GitHub Profile
#!/bin/bash
semver_gt() {
awk -v v1="$1" -v v2="$2" 'BEGIN {
split(v1, a, "."); split(v2, b, ".");
for (i=1; i<=3; i++) {
if (a[i]+0 > b[i]+0) { print "true"; exit }
if (a[i]+0 < b[i]+0) { print "false"; exit }
}
print "false"