Index: /trunk/FACT++/src/Readline.cc
===================================================================
--- /trunk/FACT++/src/Readline.cc	(revision 10653)
+++ /trunk/FACT++/src/Readline.cc	(revision 10654)
@@ -897,4 +897,5 @@
     fprintf(rl_outstream, "   c,commands   Dump available commands\n");
     fprintf(rl_outstream, "   k,keylist    Dump key bindings\n");
+    fprintf(rl_outstream, "   .x filename  Execute a script of commands\n");
     fprintf(rl_outstream, "   .q,quit      Quit\n");
     fprintf(rl_outstream, "\n");
@@ -941,4 +942,10 @@
 bool Readline::Process(const string &str)
 {
+    if (str.substr(0, 3)==".x ")
+    {
+         Execute(str.substr(3));
+         return true;
+    }
+
     // ----------- Readline static -------------
 
@@ -1081,4 +1088,47 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//! Executes commands read from an ascii file as they were typed in
+//! the console. Empty lines and lines beginning with # are ignored.
+//!
+//! @param fname
+//!    Filename of file to read
+//!
+//! @returns
+//!    -1 if the file couldn't be read and the number of command for which
+//!    Process() was callled otherwise
+//!
+int Readline::Execute(const string &fname)
+{
+    int rc = 0;
+
+    ifstream fin(Tools::Trim(fname).c_str());
+    if (!fin)
+        return -1;
+
+    string buffer;
+    while (getline(fin, buffer, '\n'))
+    {
+        buffer = Tools::Trim(buffer);
+        if (buffer.empty())
+            continue;
+
+        if (buffer[0]=='#')
+            continue;
+
+        rc++;
+
+        if (Process(buffer))
+            continue;
+
+        fLine++;
+
+        AddToHistory(buffer);
+    }
+
+    return rc;
+}
+
 void Readline::Stop()
 {
Index: /trunk/FACT++/src/Readline.h
===================================================================
--- /trunk/FACT++/src/Readline.h	(revision 10653)
+++ /trunk/FACT++/src/Readline.h	(revision 10654)
@@ -87,4 +87,5 @@
     virtual void Run(const char *prompt=0);
     static  void Stop();
+    int      Execute(const std::string &fname);
 
     int GetLine() const { return fLine; }
Index: /trunk/FACT++/src/ReadlineColor.cc
===================================================================
--- /trunk/FACT++/src/ReadlineColor.cc	(revision 10653)
+++ /trunk/FACT++/src/ReadlineColor.cc	(revision 10654)
@@ -151,4 +151,5 @@
     out << kBold << "   k,keylist    " << kReset << "Dump key bindings" << endl;
     out << kBold << "   a,attrs      " << kReset << "Dump available stream attributes" << endl;
+    out << kBold << "   .x filename  " << kReset << "Execute a script of commands" << endl;
     out << kBold << "   .q,quit      " << kReset << "Quit" << endl;
     out << endl;
