#!/bin/bash
MAXIMA=`type -p maxima 2>/dev/null`
if [ $? -eq 0 ]
then
  if grep -F list-avail $MAXIMA >/dev/null
  then maxima --list-avail | sed -e '1d' -e 's/version /"/' \
    -e 's/, lisp / /' -e 's/$/"/' -e '2s/^/(/' -e '$s/$/)/'
  else
    if grep -F clisp $MAXIMA >/dev/null
    then echo '("5.6 clisp")'
    else echo '("5.6 gcl")'
    fi
  fi
else echo '#f'
fi
