Use rlwrap
to enable arrow keys, command history,
history completion and search
$more mma.sh
#!/usr/bin/env bash
rlwrap --file /opt/local/share/rlwrap/MathKernel /Applications/Mathematica.app/Contents/MacOS/MathKernel
$ ./mma.sh
Mathematica 8.0 for macOS x86 (64-bit)
Copyright 1988-2011 Wolfram Research, Inc.
In[1]:= 1+Sin[2]//N
Out[1]= 1.9093
In[2]:=
At an input In[XXX]
, one can
-
press up and down arrow keys to insert previously entered commands
-
press left and right arrow keys to move cursor