Index: /trunk/FACT++/src/Readline.cc
===================================================================
--- /trunk/FACT++/src/Readline.cc	(revision 11325)
+++ /trunk/FACT++/src/Readline.cc	(revision 11326)
@@ -861,4 +861,45 @@
 // --------------------------------------------------------------------------
 //
+//! Execute a shell command through a pipe. Write stdout to rl_outstream
+//!
+//! @param cmd
+//!     Command to be executed
+//!
+//! @returns
+//!     always true
+//
+bool Readline::ExecuteShellCommand(const string &cmd)
+{
+    FILE *pipe = popen(cmd.c_str(), "r");
+    if (!pipe)
+    {
+        fprintf(rl_outstream, "ERROR - Could not create pipe '%s': %m\n", cmd.c_str());
+        return true;
+    }
+
+    while (1)
+    {
+        char buf[1024];
+
+        const size_t sz = fread(buf, 1, 1024, pipe);
+
+        fwrite(buf, 1, sz, rl_outstream);
+
+        if (feof(pipe) || ferror(pipe))
+            break;
+    }
+
+    if (ferror(pipe))
+        fprintf(rl_outstream, "ERROR - Reading from pipe '%s': %m\n", cmd.c_str());
+
+    pclose(pipe);
+
+    fprintf(rl_outstream, "\n");
+
+    return true;
+}
+
+// --------------------------------------------------------------------------
+//
 //! Print the available commands. This is intended for being overwritten
 //! by deriving classes.
@@ -903,4 +944,5 @@
     fprintf(rl_outstream, "   c,commands   Dump available commands\n");
     fprintf(rl_outstream, "   k,keylist    Dump key bindings\n");
+    fprintf(rl_outstream, "   .! command   Execute a shell command\n");
     fprintf(rl_outstream, "   .w n         Sleep n milliseconds\n");
     fprintf(rl_outstream, "   .x filename  Execute a script of commands\n");
@@ -961,4 +1003,10 @@
     }
 
+    if (str.substr(0, 2)==".!")
+    {
+         ExecuteShellCommand(str.substr(2));
+         return true;
+    }
+
     // ----------- Readline static -------------
 
Index: /trunk/FACT++/src/Readline.h
===================================================================
--- /trunk/FACT++/src/Readline.h	(revision 11325)
+++ /trunk/FACT++/src/Readline.h	(revision 11326)
@@ -90,4 +90,5 @@
     virtual void Run(const char *prompt=0);
     static  void Stop();
+    virtual bool ExecuteShellCommand(const std::string &cmd);
     int          Execute(const std::string &fname);
     bool         IsStopped() const;
Index: /trunk/FACT++/src/ReadlineColor.cc
===================================================================
--- /trunk/FACT++/src/ReadlineColor.cc	(revision 11325)
+++ /trunk/FACT++/src/ReadlineColor.cc	(revision 11326)
@@ -153,4 +153,5 @@
     out << kBold << "   k,keylist    " << kReset << "Dump key bindings" << endl;
     out << kBold << "   a,attrs      " << kReset << "Dump available stream attributes" << endl;
+    out << kBold << "   .! command   " << kReset << "Execute a shell command";
     out << kBold << "   .w n         " << kReset << "Sleep n milliseconds";
     out << kBold << "   .x filename  " << kReset << "Execute a script of commands" << endl;
@@ -161,8 +162,51 @@
 }
 
+// --------------------------------------------------------------------------
+//
+//! Execute a shell command through a pipe. Write stdout to rl_outstream
+//!
+//! @param cmd
+//!     Command to be executed
+//!
+//! @returns
+//!     always true
+//
+bool ReadlineColor::ExecuteShellCommand(ostream &out, const string &cmd)
+{
+    FILE *pipe = popen(cmd.c_str(), "r");
+    if (!pipe)
+    {
+        out << kRed << "ERROR - Could not create pipe '" << cmd << "': " << strerror(errno) << " [" << errno << "]" << endl;
+        return true;
+    }
+
+    while (1)
+    {
+        char buf[1024];
+
+        const size_t sz = fread(buf, 1, 1024, pipe);
+        out.write(buf, sz);
+
+        if (feof(pipe) || ferror(pipe))
+            break;
+    }
+
+    out << endl;
+
+    if (ferror(pipe))
+        out << kRed << "ERROR - Reading from pipe '" << cmd << "': " << strerror(errno) << " [" << errno << "]" << endl;
+
+    pclose(pipe);
+
+    return true;
+}
+
 
 bool ReadlineColor::Process(ostream &out, const string &str)
 {
     // ----------- Readline -----------
+
+    if (str.substr(0, 2)==".!")
+         return ExecuteShellCommand(out, str.substr(2));
 
     if (str=="lh" || str=="history")
Index: /trunk/FACT++/src/ReadlineColor.h
===================================================================
--- /trunk/FACT++/src/ReadlineColor.h	(revision 11325)
+++ /trunk/FACT++/src/ReadlineColor.h	(revision 11326)
@@ -6,4 +6,6 @@
 namespace ReadlineColor
 {
+    bool ExecuteShellCommand(std::ostream &out, const std::string &cmd);
+
     bool PrintBootMsg(std::ostream &out, const std::string &name, bool interactive=true);
     bool PrintAttributes(std::ostream &out);
