def loop_eval(input)
      if input == ''
        @command_mode = :system and return
      end

      case @command_mode
      when :system # generate ruby code to execute the command
        if !@result_storage
          ruby_command_code = "_ = system '#{ input }'\n"
        else
          temp_file = "/tmp/ripl-fresh_#{ rand 12345678901234567890 }"
          ruby_command_code = "_ = system '#{ input } 2>&1', :out => '#{ temp_file }'\n"
          
          # assign result to result storage variable
          case @result_operator
          when '=>', '=>>'
            result_literal   = "[]"
            formatted_result = "File.read('#{ temp_file }').split($/)"
            operator = @result_operator == '=>>' ? '+=' : '='
          when '~>', '~>>'
            result_literal = "''"
            formatted_result = "File.read('#{ temp_file }')"
            operator = @result_operator == '~>>' ? '<<' : '='
          end
          ruby_command_code << %Q%
            #{ @result_storage } ||= #{ result_literal }
            #{ @result_storage } #{ operator } #{ formatted_result }
            FileUtils.rm '#{ temp_file }'
          %
        end

        # ruby_command_code << "raise( SystemCallError.new $?.exitstatus ) if !_\n" # easy auto indent
        ruby_command_code << "if !_
                                raise( SystemCallError.new $?.exitstatus )
                              end;"
        
        super @input = ruby_command_code

      when :mixed # call the ruby method, but with shell style arguments TODO more shell like (e.g. "")
        method_name, *args = *input.split
        super @input = "#{ method_name }(*#{ args })"

      else # good old :ruby
        super
      end
    end
def loop_eval(input)
      if input == ''
        @command_mode = :system and return
      end

      case @command_mode
      when :system # generate ruby code to execute the command
        if !@result_storage
          ruby_command_code = "_ = system '#{ input }'\n"
        else
          temp_file = "/tmp/ripl-fresh_#{ rand 12345678901234567890 }"
          ruby_command_code = "_ = system '#{ input } 2>&1', :out => '#{ temp_file }'\n"
          
          # assign result to result storage variable
          case @result_operator
          when '=>', '=>>'
            result_literal   = "[]"
            formatted_result = "File.read('#{ temp_file }').split($/)"
            operator = @result_operator == '=>>' ? '+=' : '='
          when '~>', '~>>'
            result_literal = "''"
            formatted_result = "File.read('#{ temp_file }')"
            operator = @result_operator == '~>>' ? '<<' : '='
          end
          ruby_command_code << %Q%
            #{ @result_storage } ||= #{ result_literal }
            #{ @result_storage } #{ operator } #{ formatted_result }
            FileUtils.rm '#{ temp_file }'
          %
        end

        # ruby_command_code << "raise( SystemCallError.new $?.exitstatus ) if !_\n" # easy auto indent
        ruby_command_code << "if !_
                                raise( SystemCallError.new $?.exitstatus )
                              end;"
        
        super @input = ruby_command_code

      when :mixed # call the ruby method, but with shell style arguments TODO more shell like (e.g. "")
        method_name, *args = *input.split
        super @input = "#{ method_name }(*#{ args })"

      else # good old :ruby
        super
      end
    end
get result (depending on @command_mode)