Skip to content

Instantly share code, notes, and snippets.

@xmarcos
Created January 25, 2013 18:34
Show Gist options
  • Save xmarcos/4636759 to your computer and use it in GitHub Desktop.
Save xmarcos/4636759 to your computer and use it in GitHub Desktop.
If the "Standard ML of New Jersey" is installed it will return the path of the last version found otherwise an empty string. The script works on the assumption that SML/NJ was installed using the official installer, and the root directory is the default /usr/local/smlnj http://www.smlnj.org/dist/working/110.75/NOTES/MACOSXINSTALL Created because…
#!/bin/bash
#
# If the "Standard ML of New Jersey" is installed it will return the path of
# the last version found otherwise an empty string.
#
# The script works on the assumption that SML/NJ was installed using the
# official installer, and the root directory is the default /usr/local/smlnj
# http://www.smlnj.org/dist/working/110.75/NOTES/MACOSXINSTALL
#
# find /usr/local/smlnj-*/bin -type d -maxdepth 0 | sort -nr | head -n1
#
# Copyright (c) 2013 Marcos Sader
# https://gist.github.com/xmarcos
# Distributed under the The MIT License
#
LAST_VERSION="";
FIND_PATH=`find /usr/local/smlnj-*/bin -type d -maxdepth 0 | sort -nr | head -n1`;
if [ -d "$FIND_PATH" ]; then
LAST_VERSION="$FIND_PATH"
fi
echo "$LAST_VERSION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment