| 1 |
#!/bin/sh |
| 2 |
# This shell script runs m4 Mathomatic (matho) with readline capability. |
| 3 |
# Uses rlwrap program, if available, which is a readline front end. |
| 4 |
# The rlwrap program may be obtained at |
| 5 |
# http://utopia.knoware.nl/~hlub/uck/rlwrap/ |
| 6 |
# |
| 7 |
# Usage: rmath [ input_files ] |
| 8 |
|
| 9 |
MATHOPATH="${0%/rmath}/matho" |
| 10 |
if [ ! -x "$MATHOPATH" ] |
| 11 |
then |
| 12 |
MATHOPATH=matho |
| 13 |
fi |
| 14 |
|
| 15 |
if rlwrap true |
| 16 |
then |
| 17 |
rlwrap -H ~/.matho_history "$MATHOPATH" "$@" |
| 18 |
else |
| 19 |
echo readline support not loaded because \"rlwrap\" utility was not found. |
| 20 |
"$MATHOPATH" "$@" |
| 21 |
fi |