def shell_exec_monitor(self, Command, PluginInfo):
        #if not self.CommandInfo:
        CommandInfo = self.StartCommand(Command, Command)
        #Target, CanRun = self.CanRunCommand(self.CommandInfo)
        Target, CanRun = self.CanRunCommand(CommandInfo)
        if not CanRun:
            Message = "The command was already run for target: " + str(Target)
            return Message
        logging.info("")
        logging.info("Executing :\n\n%s\n\n", Command)
        logging.info("")
        logging.info("------> Execution Start Date/Time: " + self.timer.get_start_date_time_as_str('Command'))
        logging.info("")
        Output = ''
        Cancelled = False
        try:  # Stolen from: http://stackoverflow.com/questions/5833716/how-to-capture-output-of-a-shell-script-running-in-a-separate-process-in-a-wxpyt
            proc = self.create_subprocess(Command)
            while True:
                line = proc.stdout.readline()
                if not line: break
                # NOTE: Below MUST BE print instead of "cprint" to clearly distinguish between owtf output and tool output
                logging.warn(line.strip())  # Show progress on the screen too!
                Output += line  # Save as much output as possible before a tool crashes! :)
        except KeyboardInterrupt:
            os.killpg(proc.pid, signal.SIGINT)
            outdata, errdata = proc.communicate()
            logging.warn(outdata)
            Output += outdata
            try:
                os.killpg(os.getpgid(proc.pid), signal.SIGTERM)  # Plugin KIA (Killed in Action)
            except __HOLE__:
                pass  # Plugin RIP (Rested In Peace)
            Cancelled = True
            #self.FinishCommand(self.CommandInfo, Cancelled)
            Output += self.error_handler.UserAbort('Command', Output)  # Identify as Command Level abort
        finally:
            self.FinishCommand(CommandInfo, Cancelled, PluginInfo)

        return scrub_output(Output)
dataset/ETHPy150Open owtf/owtf/framework/shell/blocking_shell.py/Shell.shell_exec_monitor