Skip to content

Instantly share code, notes, and snippets.

@kenkendk
Created December 9, 2015 14:12
Show Gist options
  • Save kenkendk/a2123ae65acf261ead9f to your computer and use it in GitHub Desktop.
Save kenkendk/a2123ae65acf261ead9f to your computer and use it in GitHub Desktop.
Test mono version
#!/bin/sh
REQUIRED_MAJOR=2
REQUIRED_MINOR=8
MONO_VERSION="$(mono --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )"
MONO_VERSION_MAJOR="$(echo $MONO_VERSION | cut -f1 -d.)"
MONO_VERSION_MINOR="$(echo $MONO_VERSION | cut -f2 -d.)"
if [ -z "$MONO_VERSION" ] \
|| [ $MONO_VERSION_MAJOR -lt $REQUIRED_MAJOR ] \
|| [ $MONO_VERSION_MAJOR -eq $REQUIRED_MAJOR -a $MONO_VERSION_MINOR -lt $REQUIRED_MINOR ]
then
echo "Your mono version is $MONO_VERSION, but at least ${REQUIRED_MAJOR}.${REQUIRED_MINOR} is needed"
else
echo "Your mono version is recent enough: $MONO_VERSION"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment