// ExecuteCommand executes the given command in the working directory.
431615
func ExecuteCommand(command []string, workingDir string, outputStreamWriter io.Writer, errorStreamWriter io.Writer) (*exec.Cmd, error) {
	cmd := prepareCommand(false, command, workingDir, outputStreamWriter, errorStreamWriter)
	err := cmd.Start()
	return cmd, err
}
1290844
func (client *gRPCVtworkerClient) ExecuteVtworkerCommand(ctx context.Context, args []string) (logutil.EventStream, error) {
	query := &vtworkerdatapb.ExecuteVtworkerCommandRequest{
		Args: args,
	}

	stream, err := client.c.ExecuteVtworkerCommand(ctx, query)
	if err != nil {
		return nil, vterrors.FromGRPC(err)
	}
	return &eventStreamAdapter{stream}, nil
}
522790
func runcmd(args ...string) ([]byte, error) {
	cmd := append([]string{}, args...)
	glog.V(4).Infof("Executing: %v", cmd)
	output, err := exec.Command(cmd[0], cmd[1:]...).CombinedOutput()
	if err != nil {
		glog.Errorf("unable to run cmd:%s  output:%s  error:%s", cmd, string(output), err)
		return output, ErrRsyncDfCommand
	}
	return output, err
}
557510
func Execute(name string, stdin string, args ...string) (string, string, error) {
	cmd := exec.Command(name, args...)
	cmd.Stdin = strings.NewReader(stdin)
	stdout, stderr := new(bytes.Buffer), new(bytes.Buffer)
	cmd.Stdout = stdout
	cmd.Stderr = stderr

	err := cmd.Run()
	return stdout.String(), stderr.String(), errors.Annotatef(err, "cannot run command %s", name)
}
368067
func runCommand(name string, args ...string) (*exec.Cmd, error) {
	cmd := exec.Command(name, args...)
	stderr, err := cmd.StderrPipe()
	if err != nil {
		return cmd, err
	}

	stdout, err := cmd.StdoutPipe()
	if err != nil {
		return cmd, err
	}

	if err := cmd.Start(); err != nil {
		return cmd, err
	}

	go io.Copy(os.Stdout, stdout)
	go io.Copy(os.Stderr, stderr)

	return cmd, nil
}
205753
func (a *Astilectron) executeCmd(cmd *exec.Cmd) (err error) {
	var e = synchronousFunc(a.canceller, a, func() {
		err = a.executer(a, cmd)
	}, EventNameAppEventReady)

	// Update display pool
	if e.Displays != nil {
		a.displayPool.update(e.Displays)
	}

	// Create dock
	a.dock = newDock(a.canceller, a.dispatcher, a.identifier, a.writer)

	// Update supported features
	a.supported = e.Supported
	return
}
609690
func (c *commander) AddCommand(name string, command func(map[string]interface{}) interface{}) {
	c.commands[name] = command
}
1131258
func Execute(main interface{}) error {
	com, err := Command(main)
	if err != nil {
		return fmt.Errorf("getting command: %v", err)
	}

	return com.Execute()
}
327132
func execCmd(arg0 string, args ...string) ([]byte, error) {
	if wlog.LogLevel() == wlog.DEBUG {
		quoted := make([]string, 0, len(args))
		for _, arg := range args {
			quoted = append(quoted, fmt.Sprintf("%q", arg))
		}
		log.Printf("D! [inputs.snmp] Executing %q %s", arg0, strings.Join(quoted, " "))
	}

	out, err := execCommand(arg0, args...).Output()
	if err != nil {
		if err, ok := err.(*exec.ExitError); ok {
			return nil, NestedError{
				Err:       err,
				NestedErr: fmt.Errorf("%s", bytes.TrimRight(err.Stderr, "\r\n")),
			}
		}
		return nil, err
	}
	return out, nil
}
1171974
func (s *CreateJobInput) SetCommand(v *JobCommand) *CreateJobInput {
	s.Command = v
	return s
}
1207662
func runCommand(ctx context.Context, cmd *command.Command, args []string, store storage.Store, chanSize, bulkSize int) int {
	if len(args) < 2 {
		log.Printf("[ERROR] Missing required file path. ")
		cmd.Usage()
		return 2
	}
	file := strings.TrimSpace(args[len(args)-1])
	lines, err := io.GetStatementsFromFile(file)
	if err != nil {
		log.Printf("[ERROR] Failed to read file %s\n\n\t%v\n\n", file, err)
		return 2
	}
	fmt.Printf("Processing file %s\n\n", args[len(args)-1])
	for idx, stm := range lines {
		fmt.Printf("Processing statement (%d/%d):\n%s\n\n", idx+1, len(lines), stm)
		tbl, err := BQL(ctx, stm, store, chanSize, bulkSize)
		if err != nil {
			fmt.Printf("[FAIL] %v\n\n", err)
			continue
		}
		fmt.Println("Result:")
		if tbl.NumRows() > 0 {
			fmt.Println(tbl)
		}
		fmt.Printf("OK\n\n")
	}
	return 0
}
962312
func (s *ContainerOverride) SetCommand(v []*string) *ContainerOverride {
	s.Command = v
	return s
}
718770
func (s *ContainerOverrides) SetCommand(v []*string) *ContainerOverrides {
	s.Command = v
	return s
}
1131213
func AddCommand(cmd string, format int, post PostProcessor, desc, usage string) {
	pprofCommands[cmd] = &command{format, post, nil, false, desc, usage}
}
1066809
func (n *ExecNode) execCommand() *exec.Cmd {
	return &exec.Cmd{
		Path: reexec.Self(),
		Args: []string{"p2p-node", strings.Join(n.Config.Node.Services, ","), n.ID.String()},
	}
}
527402
func EscapeCommand(argv []string) string {
	var escaped []string
	for _, arg := range argv {
		escaped = append(escaped, escapeArg(arg))
	}
	return strings.Join(escaped, " ")
}
517764
func (a *API) executeRobotCommand(res http.ResponseWriter, req *http.Request) {
	if _, err := a.jsonRobotFor(req.URL.Query().Get(":robot")); err != nil {
		a.writeJSON(map[string]interface{}{"error": err.Error()}, res)
	} else {
		a.executeCommand(
			a.master.Robot(req.URL.Query().Get(":robot")).
				Command(req.URL.Query().Get(":command")),
			res,
			req,
		)
	}
}