code: public static Object groovyEvaluate(ExecutionContext context, String expression) {
          Binding binding = new Binding();
          for (Map.Entry<String, CommandSymbol> entry : context.getSymbols().entrySet()) {
              final CommandSymbol symbol = entry.getValue();
              if (symbol instanceof VarCommand) {
                  binding.setVariable(entry.getKey(), convertToJava(((VarCommand) symbol).getValue(context)));
              }
          }
          GroovyShell shell = new GroovyShell(binding);
          final Object o = shell.evaluate(expression);
          if (o instanceof GString) {
              return o.toString();
          }
          return o;
      }
docs: Evaluates an expression using Groovy. All VarCommands inside the context are used in order to evaluate the given
  expression.
  
  @param context The EC
  @param expression The expression to evaluate
  @return The value