Created
January 25, 2013 18:34
-
-
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…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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