lyx_mirror/development/MacOSX/maxima
Stephan Witt b37d6c9e94 Add shell wrapper for Maxima on MacOSX
The command line utility of Maxima is inside the Maxima.app bundle and isn't named "maxima"
2016-10-20 06:35:25 +02:00

14 lines
517 B
Bash
Executable File

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