2 # at first try the well known location
3 DIR="/Applications/Maxima.app/Contents/Resources"
4 test -f "${DIR}"/maxima.sh -a -x "${DIR}"/maxima.sh && exec "${DIR}"/maxima.sh "$@"
5 # this failed... so try PATH expansion to start the maxima shell wrapper
6 IFS=":" read -ra DIRLIST <<< "${PATH}"
7 for DIR in "${DIRLIST[@]}" ; do
8 test -f "${DIR}"/maxima.sh -a -x "${DIR}"/maxima.sh && exec "${DIR}"/maxima.sh "$@"
10 # report error and exit with failure status
12 echo Maxima shell wrapper not found.