def do_run(self, command):
        """run <ID> <F> <MODE> <CMD> [ARGS [ARGS...]]: download F and execute CMD on it
run understands the '*' filename.
MODE should be either 'r' or 'w'. 'r' only downloads the files,
'w' additionally uploads the files if they have been modified."""
        rfsi, args = self.parse_fs_command(command, nargs=-1, ret=tuple)
        if (rfsi is None) or (args is None):
            return
        rid = shlex.split(command)[0]
        if len(args) < 3:
            self.stdout.write(Text("Error: invalid argument count!\n", "red"))
            return
        mode = args[1]
        remotepath = args[0]
        # orgpath = remotepath
        if not (rfsi.isfile(remotepath) or remotepath == "*"):
            self.stdout.write(Text("Error: to download a whole directory use '*'.\n", "red"))
            return
        if mode not in ("r", "R", "w", "W"):
            self.stdout.write(Text("Error: Unknown mode!\n", "red"))
            return
        lfsi = self.FSIs[INTERN_FS_ID]
        shellcommand = " ".join(args[2:])
        self.stdout.write("Creating tempdir... ")
        localpath = os.path.join(tempfile.gettempdir(), "stash_mc_run")
        if os.path.exists(localpath):
            shutil.rmtree(localpath)
        os.mkdir(localpath)
        self.stdout.write(Text("Done", "green"))
        self.stdout.write(".\n")
        op = os.getcwd()
        if remotepath == "*":
            remotepath = rfsi.get_path()
            cd_path = None
        else:
            cd_path = localpath
        try:
            lfsi.cd(localpath)
            splitted = remotepath.split("/")
            if len(splitted) >= 2:
                lfp = splitted[-2]
            else:
                lfp = remotepath
            while lfp.startswith("/"):
                lfp = lfp[1:]
            if lfp == "":
                lfp = "exec"
            rawcpcmd = '{ri} "{rp}" {li} "{lfp}"'
            self.do_cp(rawcpcmd.format(ri=rid, rp=remotepath, lfp=lfp, li=INTERN_FS_ID))
            if mode in ("w", "W"):
                self.stdout.write("Scanning content... ")
                oldstate = modified(localpath, prev=None)
                self.stdout.write(Text("Done", "green"))
                self.stdout.write(".\n")
            if cd_path is None:
                cd_path = os.path.join(localpath, os.listdir(localpath)[0])
            self.do_shell('cd "{p}"'.format(p=cd_path))
            self.do_shell(shellcommand)
        except Exception as e:
            self.stdout.write(Text("Error: {e}!\n".format(e=e.message), "red"))
            return
        else:
            try:
                if mode in ("w", "W"):
                    self.stdout.write("Checking for content modification... ")
                    moded = modified(localpath, prev=oldstate)
                    self.stdout.write(Text("Done", "green"))
                    self.stdout.write(".\nContent modified: {m}\n".format(m=moded))
                    if moded:
                        self.stdout.write("Copying modifified content... \n")
                        if lfp == "exec":
                            tp = "/"
                        else:
                            tp = remotepath
                        if os.path.isfile(lfp):
                            if tp != "/":
                                if tp.endswith("/"):
                                    tp = tp[:-1]
                                tp = "/".join(tp.split("/")[:-1])
                            lfp = lfsi.get_path()
                            if lfp.endswith("/"):
                                lfp = lfp[1:]
                            lfsi.cd(lfp)
                            lfp = lfp.split("/")[-1]
                        rawcpcmd = '{li} "{lfp}" {ri} "{tp}"'
                        cpcmd = rawcpcmd.format(lfp=lfp, ri=rid, tp=tp, li=INTERN_FS_ID)
                        self.do_cp(cpcmd)
                        self.stdout.write(Text("Copying finished.\n", "green"))
                else:
                    pass
            except Exception as e:
                self.stdout.write(Text("Error: {m}!\n".format(m=e.message), "red"))
        finally:
            self.stdout.write("Cleaning up... ")
            self.do_shell('cd "{p}"'.format(p=op))
            try:
                shutil.rmtree(localpath)
            except:
                pass
            self.stdout.write(Text("Done", "green"))
            self.stdout.write(".\n")
run <ID> <F> <MODE> <CMD> [ARGS [ARGS...]]: download F and execute CMD on it
run understands the '*' filename.
MODE should be either 'r' or 'w'. 'r' only downloads the files,
'w' additionally uploads the files if they have been modified.
bin/mc.py