[erlang-questions] Something like csh "source" command in Erlang shell?
Thu Jul 8 15:34:36 CEST 2010
I don't think that can be done out of the box. Some assembly
is certainly required.
I wrote a small code snippet to allow saving the shell history
to a file in a format that can be handled by file:eval/1 or
file:script/1 (the difference between the two is that the latter
returns the result of the last expression, while file:eval/1
only returns 'ok').
The code doesn't bother checking whether the commands were
successful before saving, but this could be added.
How to restore the bindings in the shell would be another
challenge. I've not looked into whether it can be done without
hacking the evaluator.
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
More information about the erlang-questions