This is exactly the kind of answer I needed. The socat program looked very promising, though from the examples, no direct translation was apparent. I looked up the READLINE option on the same page which states "This requires the GNU readline and history libraries." The readline front end, rlfe, is exactly the solution I need. In short:
ANSWER
This does exactly what I want, in-line editing with history abilities. Now the arrow keys work as well as in-line copy paste etc, just as any other emacs style command line interface can do. And for those die hards out there, vi style can also be invoked.
I am not sure if it is packaged with all distos, but my gentoo already had the library with the front end (probably due to build dependencies), while an ubuntu box had neither installed but is readily available with apt-get install rlfe.
On another note I also discovered that the sage program can become a shallow interface wrapper for mathematica as well by invoking
Quote:
sage -c "mathematica_console()"
|
It isn't as good as rlfe, since mathematica's prompt "In[8]:= " can disappear. A quick check also reveals that sage uses the readline library.
Thank you Mr. C, I needed a kick in the right direction.