::
        
            Usage:
               exec FILENAME

            executes the commands in the file. See also the script command.

            Arguments:
              FILENAME   The name of the file
767769
def do_exec(self, filename):
        
        if not filename:
            Console.error("the command requires a filename as parameter")
            return

        if os.path.exists(filename):
            with open(filename, "r") as f:
                for line in f:
                    Console.ok("> {:}".format(str(line)))
                    self.onecmd(line)
        else:
            Console.error('file "{:}" does not exist.'.format(filename))
            sys.exit()
447023
def execute_file(self, filename):
        
        logger.info("Executing file: %s", format_path(filename))
        contents = self.context.execute(filename, capture=True).stdout
        num_lines = len(contents.splitlines())
        logger.debug("Execution of %s yielded % of output.",
                     format_path(filename),
                     pluralize(num_lines, 'line'))
        return contents.rstrip()
385833
def screencap_exec(self, filename: _PATH = 'screencap.png') -> None:
        ''''''
        self._execute('-s', self.device_sn, 'exec-out',
                      'screencap', '-p', '>', filename, shell=True)
1117049
def run_command=(command)
      raise JSS::InvalidDataError, 'Command to run must be a String' unless command.is_a? String
      @files_processes[:run_command] = command
      @need_to_update = true
    end
515725
def run(self, filename, wait_output=True):
        
        self._pyboard.enter_raw_repl()
        out = None
        if wait_output:
            # Run the file and wait for output to return.
            out = self._pyboard.execfile(filename)
        else:
            # Read the file and run it using lower level pyboard functions that
            # won't wait for it to finish or return output.
            with open(filename, "rb") as infile:
                self._pyboard.exec_raw_no_follow(infile.read())
        self._pyboard.exit_raw_repl()
        return out
370618
def docopt_exec(argv)
      helper = DocoptHelper.new(self)
      args   = helper.args argv
      action = find_action argv
      action or abort "Runfile error: Action not found"
      @actions[action].execute args
    end
739345
def exec_(self, columns=(), by=(), where=(), **kwds):
        
        return self._seu('exec', columns, by, where, kwds)
168263
def filename_command():
    
    try:
        config = get_config_obj(file_error=True)
    except IOError as e:
        safeprint(e, write_to_stderr=True)
        click.get_current_context().exit(1)
    else:
        safeprint(config.filename)
528680
def executable(name)
      define_method(name) do |*command|
        Executable.execute_command(name, Array(command).flatten, false)
      end

      define_method(name.to_s + '!') do |*command|
        Executable.execute_command(name, Array(command).flatten, true)
      end
    end
559137
def do_file(self, filename):
        
        with open(filename, "r") as infile:
            self._run_cmd(infile.read())
963197
def execute_command(self, command, **kwargs):
        

        self.info_log("executing command: %s" % command)

        try:
            ssh = paramiko.SSHClient()
            ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

            username = kwargs.get(
                'username',
                self.browser_config.get('username')
            )
            password = self.browser_config.get('password')

            ssh.connect(self.get_ip(), username=username, password=password)

            stdin, stdout, stderr = ssh.exec_command(command)

            ssh.close()

            return (stdout, stderr)

        except Exception as e:
            msg = "Execute_command exception: %s" % str(e)
            self.error_log(msg)
            raise Exception(msg)
614469
def run(self, params):
        

        self.params = list(reversed(params))

        if not self.params:
            self.help()
            return

        while self.params:
            p = self.params.pop()

            if p in self.command:
                # If we got a known command, execute it.
                self.command[p](self)

            elif os.path.exists(p):
                # If we were given the name of an existing file, read it.
                self.read_moc(p)

            else:
                # Otherwise raise an error.
                raise CommandError('file or command {0} not found'.format(p))
1267004
def execute(cmd):
    

    # Parse cmd string to a list
    if not isinstance(cmd, list):
        cmd = shlex.split(cmd)
    # Execute command
    rc = 0
    output = ""
    try:
        output = subprocess.check_output(cmd, close_fds=True,
                                         stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError as err:
        rc = err.returncode
        output = err.output
    except Exception as err:
        err_msg = ('Command "%s" Error: %s' % (' '.join(cmd), str(err)))
        raise exception.SDKInternalError(msg=err_msg)

    output = bytes.decode(output)
    return (rc, output)
1257381
def _perform_file_action(self, filename, action):
        
        ext = os.path.splitext(filename)[1]
        try:
            func = getattr(self, '_{}_{}'.format(action, ext[1:]))
        except AttributeError:
            raise Exception('Unsupported file type {}'.format(ext[1:]))
        func(filename)
1300895
function exec() {

  var actions = {
    commands: {
      init: { action: _init },
      gen: { action: _gen },
      watch: { action: _watch },
      drift: { action: _watch },
      clean: { action: _clean }
    }
  };

  bag.command(__dirname, actions);
}
777388
public static void exec_command(String command) throws IOException {
        launchProcess(command, new HashMap<String, String>(), false);
    }
614993
def __execute_cmd(name, xml):
    '''
    
    '''
    ret = {name.replace('_', ' '): {}}
    id_num = 0

    tmp_dir = os.path.join(__opts__['cachedir'], 'tmp')
    if not os.path.isdir(tmp_dir):
        os.mkdir(tmp_dir)
    with tempfile.NamedTemporaryFile(dir=tmp_dir,
                                     prefix=name + six.text_type(os.getpid()),
                                     suffix='.xml',
                                     delete=False) as fh:
        tmpfilename = fh.name
        fh.write(xml)

    cmd = __salt__['cmd.run_all']('hponcfg -f {0}'.format(tmpfilename))

    # Clean up the temp file
    __salt__['file.remove'](tmpfilename)

    if cmd['retcode'] != 0:
        for i in cmd['stderr'].splitlines():
            if i.startswith('     MESSAGE='):
                return {'Failed': i.split('=')[-1]}
        return False

    try:
        for i in ET.fromstring(''.join(cmd['stdout'].splitlines()[3:-1])):
            # Make sure dict keys don't collide
            if ret[name.replace('_', ' ')].get(i.tag, False):
                ret[name.replace('_', ' ')].update(
                    {i.tag + '_' + six.text_type(id_num): i.attrib}
                )
                id_num += 1
            else:
                ret[name.replace('_', ' ')].update(
                    {i.tag: i.attrib}
                )
    except SyntaxError:
        return True

    return ret