def run(options = {})
      @output = @status = @error_output = @error = nil
      if options[:direct]
        command = @shell.split(@command)
      else
        command = [@command]
      end
      stdin_data = options[:stdin_data] || @input
      if stdin_data
        command << { stdin_data: stdin_data }
      end
      begin
        case options[:error_output]
        when :mix # mix stderr with stdout
          @output, @status = Open3.capture2e(*command)
        when :separate
          @output, @error_output, @status = Open3.capture3(*command)
        else # :console (do not capture stderr output)
          @output, @status = Open3.capture2(*command)
        end
      rescue => error
        @error = error.dup
      end
      case options[:return]
      when :status
        @status
      when :status_value
        status_value
      when :output
        @output
      when :error_output
        @error_output
      when :command
        self
      else
        @error ? nil : @status.success? ? true : false
      end
    end
def run(options = {})
      @output = @status = @error_output = @error = nil
      if options[:direct]
        command = @shell.split(@command)
      else
        command = [@command]
      end
      stdin_data = options[:stdin_data] || @input
      if stdin_data
        command << { stdin_data: stdin_data }
      end
      begin
        case options[:error_output]
        when :mix # mix stderr with stdout
          @output, @status = Open3.capture2e(*command)
        when :separate
          @output, @error_output, @status = Open3.capture3(*command)
        else # :console (do not capture stderr output)
          @output, @status = Open3.capture2(*command)
        end
      rescue => error
        @error = error.dup
      end
      case options[:return]
      when :status
        @status
      when :status_value
        status_value
      when :output
        @output
      when :error_output
        @error_output
      when :command
        self
      else
        @error ? nil : @status.success? ? true : false
      end
    end
Execute the command.

 By default the command is executed by a shell. In this case,
 unquoted arguments are interpreted by the shell, e.g.

   SysCmd.command('echo $BASH').run # /bin/bash

 When the +:direct+ option is set to true, no shell is used and
 the command is directly executed; in this case unquoted arguments
 are not interpreted:

   SysCmd.command('echo $BASH').run # $BASH

 The exit status of the command is retained in the +status+ attribute
 (and its numeric value in the +status_value+ attribute).

 The standard output of the command is captured and retained in the
 +output+ attribute.

 By default, the standar error output of the command is not
 captured, so it will be shown on the console unless redirected.

 Standard error can be captured and interleaved with the standard
 output passing the option

     error_output: :mix

 Error output can be captured and keep separate inthe +error_output+
 attribute with this option:

     error_output: :separate

 The value returned is by defaut, like in Kernel#system,
 true if the command gives zero exit status, false for non zero exit status,
 and nil if command execution fails.

 The +:return+ option can be used to make this method return other
 attribute of the executed command.

 The +:stdin_data+ option can be used to pass a String as the
 command's standar input.