Skip to content

Instantly share code, notes, and snippets.

@iainlane
Created November 9, 2020 17:41
Show Gist options
  • Save iainlane/a6df7f4c8e928fd7d1cccc6bef643211 to your computer and use it in GitHub Desktop.
Save iainlane/a6df7f4c8e928fd7d1cccc6bef643211 to your computer and use it in GitHub Desktop.
release_ge shell
#!/bin/sh
distro-info --all | mawk "
/^$1\$/ { l = NR };
/^$2\$/ { r = NR };
END {
if (!l) {
print \"Unknown release $1\" > \"/dev/stderr\";
exit 1;
}
if (!r) {
print \"Unknown release $2\" > \"/dev/stderr\";
exit 1;
}
if (l >= r) {
exit 0
} else {
exit 1
}
}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment