Index: code/branches/core2/src/orxonox/core/CommandExecutor.cc
===================================================================
--- code/branches/core2/src/orxonox/core/CommandExecutor.cc	(revision 993)
+++ code/branches/core2/src/orxonox/core/CommandExecutor.cc	(revision 994)
@@ -46,4 +46,9 @@
 
     ConsoleCommandShortcutExtern(exec, AccessLevel::None);
+    ConsoleCommandShortcutExtern(echo, AccessLevel::None);
+
+    ConsoleCommandShortcutExtern(read, AccessLevel::None);
+    ConsoleCommandShortcutExtern(append, AccessLevel::None);
+    ConsoleCommandShortcutExtern(write, AccessLevel::None);
 
     void exec(const std::string& filename)
@@ -79,4 +84,65 @@
 
         executingFiles.erase(filename);
+        file.close();
+    }
+
+    std::string echo(const std::string& text)
+    {
+        return text;
+    }
+
+    void write(const std::string& filename, const std::string& text)
+    {
+        std::ofstream file;
+        file.open(filename.c_str(), std::fstream::out);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't write to file \"" << filename << "\"." << std::endl;
+            return;
+        }
+
+        file << text << std::endl;
+        file.close();
+    }
+
+    void append(const std::string& filename, const std::string& text)
+    {
+        std::ofstream file;
+        file.open(filename.c_str(), std::fstream::app);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't append to file \"" << filename << "\"." << std::endl;
+            return;
+        }
+
+        file << text << std::endl;
+        file.close();
+    }
+
+    std::string read(const std::string& filename)
+    {
+        std::ifstream file;
+        file.open(filename.c_str(), std::fstream::in);
+
+        if (!file.is_open())
+        {
+            COUT(1) << "Error: Couldn't read from file \"" << filename << "\"." << std::endl;
+            return "";
+        }
+
+        std::string output = "";
+        char line[1024];
+        while (file.good() && !file.eof())
+        {
+            file.getline(line, 1024);
+            output += line;
+            output += "\n";
+        }
+
+        file.close();
+
+        return output;
     }
 
@@ -200,4 +266,20 @@
     }
 
+    MultiTypeMath CommandEvaluation::getReturnvalue() const
+    {
+        if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
+        {
+            if (this->shortcut_)
+                return this->shortcut_->getReturnvalue();
+        }
+        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
+        {
+            if (this->function_)
+                return this->function_->getReturnvalue();
+        }
+
+        return MT_null;
+    }
+
 
     /////////////////////
@@ -252,6 +334,55 @@
     bool CommandExecutor::execute(const std::string& command)
     {
-        if ((CommandExecutor::getEvaluation().processedCommand_ != command) || (CommandExecutor::getEvaluation().state_ == CS_Uninitialized))
-            CommandExecutor::parse(command);
+        std::string strippedCommand = getStrippedEnclosingQuotes(command);
+
+        SubString tokensIO(strippedCommand, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+        if (tokensIO.size() >= 2)
+        {
+            if (tokensIO[tokensIO.size() - 2] == ">")
+            {
+                bool success = CommandExecutor::execute(tokensIO.subSet(0, tokensIO.size() - 2).join());
+                write(tokensIO[tokensIO.size() - 1], CommandExecutor::getEvaluation().getReturnvalue());
+                return success;
+            }
+            else if (tokensIO[tokensIO.size() - 2] == "<")
+            {
+                std::string input = read(tokensIO[tokensIO.size() - 1]);
+                if (input == "" || input.size() == 0)
+                    return CommandExecutor::execute(tokensIO.subSet(0, tokensIO.size() - 2).join());
+                else
+                    return CommandExecutor::execute(tokensIO.subSet(0, tokensIO.size() - 2).join() + " " + input);
+            }
+        }
+
+
+        SubString tokensPipeline(strippedCommand, "|", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
+        if (tokensPipeline.size() > 1)
+        {
+            bool success = true;
+            std::string returnValue = "";
+            for (int i = tokensPipeline.size() - 1; i >= 0; i--)
+            {
+                if (returnValue == "" || returnValue.size() == 0)
+                {
+                    //CommandEvaluation evaluation = CommandExecutor::evaluate(tokens[i]);
+                    if (!CommandExecutor::execute(tokensPipeline[i]))
+                        success = false;
+                }
+                else
+                {
+                    //CommandEvaluation evaluation = CommandExecutor::evaluate(tokens[i] + " " + returnValue);
+                    if (!CommandExecutor::execute(tokensPipeline[i] + " " + returnValue))
+                        success = false;
+                }
+
+                //CommandExecutor::execute(evaluation);
+                //returnValue = evaluation.getReturnvalue();
+                returnValue = CommandExecutor::getEvaluation().getReturnvalue().toString();
+            }
+            return success;
+        }
+
+        if ((CommandExecutor::getEvaluation().processedCommand_ != strippedCommand) || (CommandExecutor::getEvaluation().state_ == CS_Uninitialized))
+            CommandExecutor::parse(strippedCommand);
 
         return CommandExecutor::execute(CommandExecutor::getEvaluation());
@@ -261,5 +392,5 @@
     bool CommandExecutor::execute(const CommandEvaluation& evaluation)
     {
-        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
 
         if (evaluation.bEvaluatedParams_ && evaluation.evaluatedExecutor_)
@@ -353,5 +484,5 @@
     std::string CommandExecutor::complete(const CommandEvaluation& evaluation)
     {
-        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
 
         std::list<std::pair<const std::string*, const std::string*> > temp;
@@ -444,5 +575,5 @@
     std::string CommandExecutor::hint(const CommandEvaluation& evaluation)
     {
-        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+        SubString tokens(evaluation.processedCommand_, " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
 
         switch (evaluation.state_)
@@ -516,5 +647,5 @@
     void CommandExecutor::parse(const std::string& command, bool bInitialize)
     {
-        CommandExecutor::getEvaluation().tokens_.split((command + COMMAND_EXECUTOR_CURSOR), " ", SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+        CommandExecutor::getEvaluation().tokens_.split((command + COMMAND_EXECUTOR_CURSOR), " ", SubString::WhiteSpaces, false, '\\', false, '"', false, '(', ')', false, '\0');
         CommandExecutor::getEvaluation().processedCommand_ = command;
 
Index: code/branches/core2/src/orxonox/core/CommandExecutor.h
===================================================================
--- code/branches/core2/src/orxonox/core/CommandExecutor.h	(revision 993)
+++ code/branches/core2/src/orxonox/core/CommandExecutor.h	(revision 994)
@@ -62,4 +62,9 @@
 
     void exec(const std::string& filename);
+    std::string echo(const std::string& text);
+
+    void write(const std::string& filename, const std::string& text);
+    void append(const std::string& filename, const std::string& text);
+    std::string read(const std::string& filename);
 
     enum KeybindMode {}; // temporary
@@ -87,4 +92,6 @@
 
             void evaluateParams();
+
+            MultiTypeMath getReturnvalue() const;
 
         private:
Index: code/branches/core2/src/orxonox/core/Executor.cc
===================================================================
--- code/branches/core2/src/orxonox/core/Executor.cc	(revision 993)
+++ code/branches/core2/src/orxonox/core/Executor.cc	(revision 994)
@@ -90,5 +90,5 @@
         {
             // more than one param
-            SubString tokens(params, delimiter, SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0');
+            SubString tokens(params, delimiter, SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0');
 
             // if there are not enough params given, check if there are default values
Index: code/branches/core2/src/orxonox/core/Executor.h
===================================================================
--- code/branches/core2/src/orxonox/core/Executor.h	(revision 993)
+++ code/branches/core2/src/orxonox/core/Executor.h	(revision 994)
@@ -76,6 +76,6 @@
     else \
     { \
-        SubString tokens(params, delimiter, SubString::WhiteSpaces, false, '\\', '"', '(', ')', '\0'); \
-    \
+        SubString tokens(params, delimiter, SubString::WhiteSpaces, false, '\\', true, '"', true, '(', ')', true, '\0'); \
+        \
         for (unsigned int i = tokens.size(); i < this->functor_->getParamCount(); i++) \
         { \
@@ -86,6 +86,6 @@
             } \
         } \
-    \
-        MultiTypeMath param[paramCount]; \
+        \
+        MultiTypeMath param[MAX_FUNCTOR_ARGUMENTS]; \
         COUT(5) << "Calling Executor " << this->name_ << " through parser with " << paramCount << " parameters, using " << tokens.size() << " tokens ("; \
         for (unsigned int i = 0; i < tokens.size() && i < MAX_FUNCTOR_ARGUMENTS; i++) \
@@ -109,5 +109,8 @@
         } \
         COUT(5) << ")." << std::endl; \
-    \
+        \
+        if ((tokens.size() > paramCount) && (this->functor_->getTypenameParam(paramCount - 1) == "string")) \
+            param[paramCount - 1] = tokens.subSet(paramCount - 1).join(); \
+        \
         switch(paramCount) \
         { \
Index: code/branches/core2/src/orxonox/core/InputBuffer.cc
===================================================================
--- code/branches/core2/src/orxonox/core/InputBuffer.cc	(revision 993)
+++ code/branches/core2/src/orxonox/core/InputBuffer.cc	(revision 994)
@@ -36,5 +36,5 @@
     {
         this->bActivated_ = false;
-        this->allowedChars_ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZäöüÄÖÜ0123456789 \"().:,;_-+*/=!?";
+        this->allowedChars_ = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZäöüÄÖÜ0123456789 \"().:,;_-+*/=!?<>[|]";
         this->keyboard_ = keyboard;
         this->buffer_ = "";
Index: code/branches/core2/src/orxonox/core/Namespace.cc
===================================================================
--- code/branches/core2/src/orxonox/core/Namespace.cc	(revision 993)
+++ code/branches/core2/src/orxonox/core/Namespace.cc	(revision 994)
@@ -72,5 +72,5 @@
         while ((pos = name.find('\t')) != std::string::npos)
             name.replace(pos, 1, " ");
-        SubString tokens(name, " ", "", false, '\\', '"', '\0', '\0', '\0');
+        SubString tokens(name, " ", "", false, '\\', true, '"', true, '\0', '\0', true, '\0');
         if (this->bRoot_)
         {
Index: code/branches/core2/src/orxonox/core/OutputHandler.h
===================================================================
--- code/branches/core2/src/orxonox/core/OutputHandler.h	(revision 993)
+++ code/branches/core2/src/orxonox/core/OutputHandler.h	(revision 994)
@@ -60,6 +60,6 @@
 
             /** @brief Puts some text on the outstream. @param text The text */
-            static inline void log(const std::string& text)
-                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); }
+            static inline std::string log(const std::string& text)
+                { OutputHandler::getOutStream().setOutputLevel(0); OutputHandler::getOutStream().output(text + "\n"); return text; }
 
             /** @brief Returns a reference to the logfile. @return The logfile */
Index: code/branches/core2/src/orxonox/core/XMLPort.h
===================================================================
--- code/branches/core2/src/orxonox/core/XMLPort.h	(revision 993)
+++ code/branches/core2/src/orxonox/core/XMLPort.h	(revision 994)
@@ -32,5 +32,4 @@
 #include "util/MultiTypeMath.h"
 #include "util/tinyxml/ticpp.h"
-#include "util/SubString.h"
 #include "Executor.h"
 #include "Debug.h"
Index: code/branches/core2/src/util/Convert.h
===================================================================
--- code/branches/core2/src/util/Convert.h	(revision 993)
+++ code/branches/core2/src/util/Convert.h	(revision 994)
@@ -407,5 +407,5 @@
       if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
 
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 2)
@@ -433,5 +433,5 @@
       if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
 
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 3)
@@ -461,5 +461,5 @@
       if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
 
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 4)
@@ -491,5 +491,5 @@
       if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
 
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 4)
@@ -521,5 +521,5 @@
       if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
 
-      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', '"', '\0', '\0', '\0');
+      SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
 
       if (tokens.size() >= 4)
Index: code/branches/core2/src/util/String.cc
===================================================================
--- code/branches/core2/src/util/String.cc	(revision 993)
+++ code/branches/core2/src/util/String.cc	(revision 994)
@@ -52,4 +52,53 @@
     std::string output = std::string(str);
     strip(&output);
+    return output;
+}
+
+/**
+    @brief Removes enclosing quotes if available.
+    @brief str The string to strip
+*/
+void stripEnclosingQuotes(std::string* str)
+{
+    unsigned int start = std::string::npos;
+    unsigned int end = 0;
+
+    for (unsigned int pos = 0; (pos < (*str).size()) && (pos < std::string::npos); pos++)
+    {
+        if ((*str)[pos] == '"')
+        {
+            start = pos;
+            break;
+        }
+
+        if (((*str)[pos] != ' ') && ((*str)[pos] != '\t') && ((*str)[pos] != '\n'))
+            return;
+    }
+
+    for (unsigned int pos = (*str).size() - 1; pos < std::string::npos; pos--)
+    {
+        if ((*str)[pos] == '"')
+        {
+            end = pos;
+            break;
+        }
+
+        if (((*str)[pos] != ' ') && ((*str)[pos] != '\t') && ((*str)[pos] != '\n'))
+            return;
+    }
+
+    if ((start != std::string::npos) && (end != 0))
+        (*str) = (*str).substr(start + 1, end - start - 1);
+}
+
+/**
+    @brief Returns a copy of the string with removed enclosing quotes (if available).
+    @brief str The string to strip
+    @return The striped copy of the string
+*/
+std::string getStrippedEnclosingQuotes(const std::string& str)
+{
+    std::string output = std::string(str);
+    stripEnclosingQuotes(&output);
     return output;
 }
Index: code/branches/core2/src/util/String.h
===================================================================
--- code/branches/core2/src/util/String.h	(revision 993)
+++ code/branches/core2/src/util/String.h	(revision 994)
@@ -36,4 +36,7 @@
 _UtilExport void        strip(std::string* str);
 _UtilExport std::string getStripped(const std::string& str);
+
+_UtilExport void        stripEnclosingQuotes(std::string* str);
+_UtilExport std::string getStrippedEnclosingQuotes(const std::string& str);
 
 _UtilExport bool        isEmpty(const std::string& str);
Index: code/branches/core2/src/util/SubString.cc
===================================================================
--- code/branches/core2/src/util/SubString.cc	(revision 993)
+++ code/branches/core2/src/util/SubString.cc	(revision 994)
@@ -66,7 +66,8 @@
 SubString::SubString(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                     char escapeChar, char safemode_char, char openparenthesis_char, char closeparenthesis_char, char comment_char)
-{
-  SubString::splitLine(this->strings, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, safemode_char, openparenthesis_char, closeparenthesis_char, comment_char);
+                     char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                     char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
+{
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
 }
 
@@ -79,5 +80,8 @@
 {
   for (unsigned int i = subSetBegin; i < subString.size(); i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -91,6 +95,9 @@
 SubString::SubString(const SubString& subString, unsigned int subSetBegin, unsigned int subSetEnd)
 {
-  for (unsigned int i = subSetBegin; i < subString.size() || i < subSetEnd; i++)
+  for (unsigned int i = subSetBegin; i < subString.size() && i < subSetEnd; i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
 }
 
@@ -103,5 +110,8 @@
 {
   for(unsigned int i = 0; i < argc; ++i)
+  {
     this->strings.push_back(std::string(argv[i]));
+    this->bInSafemode.push_back(false);
+  }
 }
 
@@ -129,4 +139,5 @@
 {
   this->strings = subString.strings;
+  this->bInSafemode = subString.bInSafemode;
   return *this;
 }
@@ -140,5 +151,5 @@
 bool SubString::operator==(const SubString& subString) const
 {
-  return (this->strings == subString.strings);
+  return ((this->strings == subString.strings) && (this->bInSafemode == subString.bInSafemode));
 }
 
@@ -165,5 +176,5 @@
 
   for (unsigned int i = 0; i < length; i++)
-    if (this->strings[i] != subString.strings[i])
+    if ((this->strings[i] != subString.strings[i]) || (this->bInSafemode[i] != subString.bInSafemode[i]))
       return false;
   return true;
@@ -190,5 +201,8 @@
 {
   for (unsigned int i = 0; i < subString.size(); i++)
+  {
     this->strings.push_back(subString[i]);
+    this->bInSafemode.push_back(subString.isInSafemode(i));
+  }
   return *this;
 }
@@ -203,8 +217,9 @@
 {
   this->strings.clear();
+  this->bInSafemode.clear();
   char split[2];
   split[0] = splitter;
   split[1] = '\0';
-  SubString::splitLine(this->strings, string, split);
+  SubString::splitLine(this->strings, this->bInSafemode, string, split);
   return strings.size();
 }
@@ -223,8 +238,10 @@
 unsigned int SubString::split(const std::string& string,
                               const std::string& delimiters, const std::string& delimiterNeighbours, bool emptyEntries,
-                              char escapeChar, char safemode_char, char openparenthesis_char, char closeparenthesis_char, char comment_char)
+                              char escapeChar, bool removeExcapeChar, char safemode_char, bool removeSafemodeChar,
+                              char openparenthesis_char, char closeparenthesis_char, bool removeParenthesisChars, char comment_char)
 {
   this->strings.clear();
-  SubString::splitLine(this->strings, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, safemode_char, openparenthesis_char, closeparenthesis_char, comment_char);
+  this->bInSafemode.clear();
+  SubString::splitLine(this->strings, this->bInSafemode, string, delimiters, delimiterNeighbours, emptyEntries, escapeChar, removeExcapeChar, safemode_char, removeSafemodeChar, openparenthesis_char, closeparenthesis_char, removeParenthesisChars, comment_char);
   return this->strings.size();
 }
@@ -292,7 +309,11 @@
  * @param escape_char: Escape carater (escapes splitters)
  * @param safemode_char: the beginning of the safemode is marked with this
+ * @param removeSafemodeChar removes the safemode_char from the beginning and the ending of a token
+ * @param openparenthesis_char the beginning of a safemode is marked with this
+ * @param closeparenthesis_char the ending of a safemode is marked with this
+ * @param removeParenthesisChars removes the parenthesis from the beginning and the ending of a token
  * @param comment_char: the beginning of a comment is marked with this: (until the end of a Line)
  * @param start_state: the Initial state on how to parse the String.
- * @returns SPLIT_LINE_STATE the parser was in when returning
+ * @return SPLIT_LINE_STATE the parser was in when returning
  *
  * This is the Actual Splitting Algorithm from Clemens Wacha
@@ -302,4 +323,5 @@
 SubString::SPLIT_LINE_STATE
 SubString::splitLine(std::vector<std::string>& ret,
+                     std::vector<bool>& bInSafemode,
                      const std::string& line,
                      const std::string& delimiters,
@@ -307,7 +329,10 @@
                      bool emptyEntries,
                      char escape_char,
+                     bool removeExcapeChar,
                      char safemode_char,
+                     bool removeSafemodeChar,
                      char openparenthesis_char,
                      char closeparenthesis_char,
+                     bool removeParenthesisChars,
                      char comment_char,
                      SPLIT_LINE_STATE start_state)
@@ -318,4 +343,5 @@
 
   std::string token;
+  bool inSafemode = false;
 
   if(start_state != SL_NORMAL && ret.size() > 0)
@@ -323,4 +349,9 @@
     token = ret[ret.size()-1];
     ret.pop_back();
+  }
+  if(start_state != SL_NORMAL && bInSafemode.size() > 0)
+  {
+    inSafemode = bInSafemode[bInSafemode.size()-1];
+    bInSafemode.pop_back();
   }
 
@@ -333,12 +364,20 @@
         {
           state = SL_ESCAPE;
+          if (!removeExcapeChar)
+            token += line[i];
         }
         else if(line[i] == safemode_char)
         {
           state = SL_SAFEMODE;
+          inSafemode = true;
+          if (!removeSafemodeChar)
+            token += line[i];
         }
         else if(line[i] == openparenthesis_char)
         {
           state = SL_PARENTHESES;
+          inSafemode = true;
+          if (!removeParenthesisChars)
+            token += line[i];
         }
         else if(line[i] == comment_char)
@@ -351,4 +390,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           token += line[i];       // EAT
@@ -365,4 +406,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           state = SL_NORMAL;
@@ -386,13 +429,18 @@
         break;
       case SL_ESCAPE:
-        if(line[i] == 'n') token += '\n';
-        else if(line[i] == 't') token += '\t';
-        else if(line[i] == 'v') token += '\v';
-        else if(line[i] == 'b') token += '\b';
-        else if(line[i] == 'r') token += '\r';
-        else if(line[i] == 'f') token += '\f';
-        else if(line[i] == 'a') token += '\a';
-        else if(line[i] == '?') token += '\?';
-        else token += line[i];  // EAT
+        if (!removeSafemodeChar)
+          token += line[i];
+        else
+        {
+          if(line[i] == 'n') token += '\n';
+          else if(line[i] == 't') token += '\t';
+          else if(line[i] == 'v') token += '\v';
+          else if(line[i] == 'b') token += '\b';
+          else if(line[i] == 'r') token += '\r';
+          else if(line[i] == 'f') token += '\f';
+          else if(line[i] == 'a') token += '\a';
+          else if(line[i] == '?') token += '\?';
+          else token += line[i];  // EAT
+        }
         state = SL_NORMAL;
         break;
@@ -401,4 +449,6 @@
         {
           state = SL_NORMAL;
+          if (!removeSafemodeChar)
+            token += line[i];
         }
         else if(line[i] == escape_char)
@@ -429,4 +479,6 @@
         {
           state = SL_NORMAL;
+          if (!removeParenthesisChars)
+            token += line[i];
         }
         else if(line[i] == escape_char)
@@ -461,4 +513,6 @@
             ret.push_back(token);
             token.clear();
+            bInSafemode.push_back(inSafemode);
+            inSafemode = false;
           }
           state = SL_NORMAL;
@@ -484,4 +538,6 @@
     ret.push_back(token);
     token.clear();
+    bInSafemode.push_back(inSafemode);
+    inSafemode = false;
   }
   return(state);
Index: code/branches/core2/src/util/SubString.h
===================================================================
--- code/branches/core2/src/util/SubString.h	(revision 993)
+++ code/branches/core2/src/util/SubString.h	(revision 994)
@@ -88,5 +88,6 @@
   SubString(const std::string& string,
             const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries=false,
-            char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
+            char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+            char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   SubString(unsigned int argc, const char** argv);
   /** @brief create a Substring as a copy of another one. @param subString the SubString to copy. */
@@ -111,5 +112,6 @@
   unsigned int split(const std::string& string,
                      const std::string& delimiters, const std::string& delimiterNeighbours = "", bool emptyEntries = false,
-                     char escapeChar ='\\', char safemode_char = '"', char openparenthesis_char = '(', char closeparenthesis_char = ')', char comment_char = '\0');
+                     char escapeChar ='\\', bool removeExcapeChar = true, char safemode_char = '"', bool removeSafemodeChar = true,
+                     char openparenthesis_char = '(', char closeparenthesis_char = ')',  bool removeParenthesisChars = true, char comment_char = '\0');
   std::string join(const std::string& delimiter = " ") const;
   ////////////////////////////////////////
@@ -120,21 +122,24 @@
 
   // retrieve Information from within
-  /** @returns true if the SubString is empty */
+  /** @brief Returns true if the SubString is empty */
   inline bool empty() const { return this->strings.empty(); };
-  /** @returns the count of Strings stored in this substring */
+  /** @brief Returns the count of Strings stored in this substring */
   inline unsigned int size() const { return this->strings.size(); };
-  /** @param i the i'th String @returns the i'th string from the subset of Strings */
+  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
   inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
-  /** @param i the i'th String @returns the i'th string from the subset of Strings */
+  /** @brief Returns the i'th string from the subset of Strings @param i the i'th String */
   inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
-  /** @returns the front of the StringList. */
+  /** @brief Returns true if the token is in safemode. @param i the i'th token */
+  inline bool isInSafemode(unsigned int i) const { return this->bInSafemode[i]; }
+  /** @brief Returns the front of the StringList. */
   inline const std::string& front() const { return this->strings.front(); };
-  /** @returns the back of the StringList. */
+  /** @brief Returns the back of the StringList. */
   inline const std::string& back() const { return this->strings.back(); };
   /** @brief removes the back of the strings list. */
-  inline void pop_back() { this->strings.pop_back(); };
+  inline void pop_back() { this->strings.pop_back(); this->bInSafemode.pop_back(); };
 
   // the almighty algorithm.
   static SPLIT_LINE_STATE splitLine(std::vector<std::string>& ret,
+                                    std::vector<bool>& bInSafemode,
                                     const std::string& line,
                                     const std::string& delimiters = SubString::WhiteSpaces,
@@ -142,7 +147,10 @@
                                     bool emptyEntries = false,
                                     char escape_char = '\\',
+                                    bool removeExcapeChar = true,
                                     char safemode_char = '"',
+                                    bool removeSafemodeChar = true,
                                     char openparenthesis_char = '(',
                                     char closeparenthesis_char = ')',
+                                    bool removeParenthesisChars = true,
                                     char comment_char = '\0',
                                     SPLIT_LINE_STATE start_state = SL_NORMAL);
@@ -157,4 +165,5 @@
 private:
   std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
+  std::vector<bool>         bInSafemode;
 };
 
