Index: trunk/FACT++/src/datalogger.cc
===================================================================
--- trunk/FACT++/src/datalogger.cc	(revision 11217)
+++ trunk/FACT++/src/datalogger.cc	(revision 11218)
@@ -2526,4 +2526,22 @@
 
     boost::thread t(boost::bind(RunThread, &logger));
+
+    if (conf.Has("cmd"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("cmd");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.ProcessLine(*it);
+    }
+
+    if (conf.Has("exec"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("exec");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.Execute(*it);
+    }
+
+    if (conf.Get<bool>("quit"))
+        shell.Stop();
+
     
     shell.Run(); // Run the shell
@@ -2594,4 +2612,7 @@
         ("log,l",     var<string>(n), "Write log-file")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
+        ("cmd",       vars<string>(), "Execute one or more commands at startup")
+        ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
+        ("quit,q",    po_switch(),    "Quit after startup");
         ;
 
Index: trunk/FACT++/src/dimctrl.cc
===================================================================
--- trunk/FACT++/src/dimctrl.cc	(revision 11217)
+++ trunk/FACT++/src/dimctrl.cc	(revision 11218)
@@ -22,4 +22,11 @@
             win << kRed << "ERROR - Couldn't open log-file " << conf.Get<string>("log") << ": " << strerror(errno) << endl;
 
+    if (conf.Has("cmd"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("cmd");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.ProcessLine(*it);
+    }
+
     if (conf.Has("exec"))
     {
@@ -28,4 +35,7 @@
             shell.Execute(*it);
     }
+
+    if (conf.Get<bool>("quit"))
+        shell.Stop();
 
     shell.Run();
@@ -43,5 +53,7 @@
         ("log,l",     var<string>(n), "Write log-file")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
+        ("cmd",       vars<string>(), "Execute one or more commands at startup")
         ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
+        ("quit,q",    po_switch(),    "Quit after startup");
         ;
 
Index: trunk/FACT++/src/drivectrl.cc
===================================================================
--- trunk/FACT++/src/drivectrl.cc	(revision 11217)
+++ trunk/FACT++/src/drivectrl.cc	(revision 11218)
@@ -912,4 +912,11 @@
     // boost::thread t(boost::bind(&StateMachineDrive<S>::Run, &io_service));
 
+    if (conf.Has("cmd"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("cmd");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.ProcessLine(*it);
+    }
+
     if (conf.Has("exec"))
     {
@@ -918,4 +925,7 @@
             shell.Execute(*it);
     }
+
+    if (conf.Get<bool>("quit"))
+        shell.Stop();
 
     shell.Run();                 // Run the shell
@@ -941,5 +951,7 @@
         ("no-dim,d",  po_switch(),    "Disable dim services")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
-        ("exec,e",    vars<strings>(),"Execute one or more scrips at startup")
+        ("cmd",       vars<string>(), "Execute one or more commands at startup")
+        ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
+        ("quit,q",    po_switch(),    "Quit after startup");
         ;
 
Index: trunk/FACT++/src/fadctrl.cc
===================================================================
--- trunk/FACT++/src/fadctrl.cc	(revision 11217)
+++ trunk/FACT++/src/fadctrl.cc	(revision 11218)
@@ -1711,4 +1711,11 @@
     //boost::thread t(boost::bind(&StateMachineFAD<S>::Run, &io_service));
 
+    if (conf.Has("cmd"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("cmd");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.ProcessLine(*it);
+    }
+
     if (conf.Has("exec"))
     {
@@ -1717,4 +1724,7 @@
             shell.Execute(*it);
     }
+
+    if (conf.Get<bool>("quit"))
+        shell.Stop();
 
     shell.Run();                 // Run the shell
@@ -1739,5 +1749,7 @@
         ("no-dim,d",  po_switch(),    "Disable dim services")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
+        ("cmd",       vars<string>(), "Execute one or more commands at startup")
         ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
+        ("quit,q",    po_switch(),    "Quit after startup");
         ;
 
Index: trunk/FACT++/src/fscctrl.cc
===================================================================
--- trunk/FACT++/src/fscctrl.cc	(revision 11217)
+++ trunk/FACT++/src/fscctrl.cc	(revision 11218)
@@ -584,4 +584,11 @@
     // boost::thread t(boost::bind(&StateMachineFSC<S>::Run, &io_service));
 
+    if (conf.Has("cmd"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("cmd");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.ProcessLine(*it);
+    }
+
     if (conf.Has("exec"))
     {
@@ -590,4 +597,7 @@
             shell.Execute(*it);
     }
+
+    if (conf.Get<bool>("quit"))
+        shell.Stop();
 
     shell.Run();                 // Run the shell
@@ -613,5 +623,7 @@
         ("no-dim,d",  po_bool(),      "Disable dim services")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
+        ("cmd",       vars<string>(), "Execute one or more commands at startup")
         ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
+        ("quit,q",    po_switch(),    "Quit after startup");
         ;
 
Index: trunk/FACT++/src/ftmctrl.cc
===================================================================
--- trunk/FACT++/src/ftmctrl.cc	(revision 11217)
+++ trunk/FACT++/src/ftmctrl.cc	(revision 11218)
@@ -1897,4 +1897,11 @@
     // boost::thread t(boost::bind(&StateMachineFTM<S>::Run, &io_service));
 
+    if (conf.Has("cmd"))
+    {
+        const vector<string> v = conf.Get<vector<string>>("cmd");
+        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
+            shell.ProcessLine(*it);
+    }
+
     if (conf.Has("exec"))
     {
@@ -1903,4 +1910,7 @@
             shell.Execute(*it);
     }
+
+    if (conf.Get<bool>("quit"))
+        shell.Stop();
 
     shell.Run();                 // Run the shell
@@ -1926,5 +1936,7 @@
         ("no-dim,d",  po_bool(),      "Disable dim services")
         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
+        ("cmd",       vars<string>(), "Execute one or more commands at startup")
         ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
+        ("quit,q",    po_switch(),    "Quit after startup");
         ;
 
Index: trunk/FACT++/src/scheduler.cc
===================================================================
--- trunk/FACT++/src/scheduler.cc	(revision 11217)
+++ trunk/FACT++/src/scheduler.cc	(revision 11218)
@@ -791,5 +791,4 @@
     }
 
-    //io_service.SetReady();
     if (conf.Has("exec"))
     {
