shell question - import commands from external file

Bopolissimus Platypus Jr bopolissimus.lists@REDACTED
Mon Sep 21 07:53:52 CEST 2009


Hi all,

I have a newbie question.  In the shell, is there a way to import
*shell* commands from
an external file?  I'm often experimenting in the shell, e.g., writing
a 5 or 8 line fun,
trying out this or that function call, etc.

Since there are often mistakes, I need to rewrite the fun a few times.
 Instead of
having to retype (or look up in history) the several lines, I'd like
to write the fun
in a temporary file (e.g., ./tmp.erl) and then just load it into the
shell as if i'd
typed it in (e.g., in the postgresql shell I would do, "\i [filename").

I realize that I could write the experimental code into a temporary module,
compile that and run it.  But I'd like to know if there's a simpler way to
do it.  It's not just about avoiding the compile step, etc. I'd also like to be
able to look at the values of variables that I've set (in the "imported" shell
file), perform additional operations on those variables, etc.

Thanks a lot for any pointers.

tiger

-- 
Gerald Timothy Quimpo http://bopolissimus.blogspot.com
gquimpo@REDACTED bopolissimus.lists@REDACTED
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"

Usually, a very large amount of work goes into the
parsing step (Perl and C++ are probably the best
examples of this-both are basically unparseable.)


More information about the erlang-questions mailing list