Runs the given command, for example: {"ProcessFile", "file.txt"}

@param command the command, as a String array
338287
public static void run(String[] command) throws IOException, RDF4JException, TrustyUriException {
		String cmd = command[0];
		String[] cmdArgs = Arrays.copyOfRange(command, 1, command.length);
		if (cmd.equals("CheckFile")) {
			CheckFile.main(cmdArgs);
		} else if (cmd.equals("ProcessFile")) {
			ProcessFile.main(cmdArgs);
		} else if (cmd.equals("CheckLargeRdf")) {
			CheckLargeRdf.main(cmdArgs);
		} else if (cmd.equals("TransformRdf")) {
			TransformRdf.main(cmdArgs);
		} else if (cmd.equals("TransformLargeRdf")) {
			TransformLargeRdf.main(cmdArgs);
		} else if (cmd.equals("CheckSortedRdf")) {
			CheckSortedRdf.main(cmdArgs);
		} else {
			System.err.println("ERROR: Unrecognized command " + cmd);
			System.exit(1);
		}
	}
128372
private static String executePowerShellCommand(String command) {
        try {
            String[] commandList = {POWER_SHELL, POWER_SHELL_COMMAND, command};
            ProcessBuilder pb = new ProcessBuilder(commandList);
            Process process = pb.start();

            InputStream is = process.getInputStream();
            InputStreamReader isr = new InputStreamReader(is);
            BufferedReader br = new BufferedReader(isr);

            String line;
            while ((line = br.readLine()) != null) {
                if (line.startsWith(COMMON_NAME_PARAMETER)) {
                    String[] values = line.split(COMMA_SPLIT);
                    return values[0].substring(values[0].indexOf(EQUAL_SPLIT) + 1);
                }
            }
        } catch (Exception e) {
            // do nothing
        }
        return null;
    }
1143758
public void run(String command) throws PHPException {
		try {
			php.execRun(command);
			flushContent();
		} catch (IOException e) {
			LOGGER.error("IO Error with PhpDriver : " + e.toString());
			throw new IOErrorException(flushContentAndDropIOException());
		}
	}
243073
public String execute(String... command) {
        return commandProcessor.run(aCommand("VBoxManage").withArguments(command)).getOutput();
    }
583509
public Response execute(Command command) throws IOException {
        for (EventListener temp : listeners) {
            temp.beforeEvent(command);
        }
        Response res = commandExecutor.execute(command);

        for (EventListener temp : listeners) {
            temp.afterEvent(command);
        }

        return res;
    }
259079
public void addEngineCommand(String command)
  {
    if (command == null || command.length() == 0) {
      return;
    }
    
    int p = command.indexOf(':');
    
    String arg = "";
    
    if (p > 0) {
      arg = command.substring(p + 1);
      command = command.substring(0, p);
    }
    
    StringBuilder sb = new StringBuilder();
    
    sb.append(_engineCommands);
    
    sb.append("\1");
        
    sb.append(command);
    
    sb.append("\1");
    
    sb.append(arg);
    
    _engineCommands = sb.toString();
  }
1034290
public static ArrayList<String> runProcess(String... commands)
      throws InterruptedException, IOException {
    final java.lang.ProcessBuilder processBuilder = new java.lang.ProcessBuilder(commands);
    final ArrayList<String> output = new ArrayList<>();
    final Process process = processBuilder.start();
    process.waitFor();
    final InputStream inputStream = process.getInputStream();
    try {
      final java.io.BufferedReader reader = new java.io.BufferedReader(
          new InputStreamReader(inputStream, StandardCharsets.UTF_8));
      String line;
      while ((line = reader.readLine()) != null) {
        output.add(line);
      }
    } finally {
      inputStream.close();
    }
    return output;
  }
762646
def run(self, lines):
        

        text = "\n".join(lines)
        while 1:
            m = BLOCK_RE.search(text)
            if m:
                command = m.group('command')
                # Whitelist command, prevent command injection.
                if command not in SUPPORTED_COMMAMDS:
                    raise Exception('Command not supported: %s' % command)
                filename = m.group('filename')
                content = m.group('content')
                filetype = filename[filename.rfind('.')+1:]

                args = [command, '-T'+filetype]
                try:
                    proc = subprocess.Popen(
                        args,
                        stdin=subprocess.PIPE,
                        stderr=subprocess.PIPE,
                        stdout=subprocess.PIPE)
                    proc.stdin.write(content.encode('utf-8'))

                    output, err = proc.communicate()

                    if filetype == 'svg':
                        data_url_filetype = 'svg+xml'
                        encoding = 'utf-8'
                        img = output.decode(encoding)

                    if filetype == 'png':
                        data_url_filetype = 'png'
                        encoding = 'base64'
                        output = base64.b64encode(output)
                        data_path = "data:image/%s;%s,%s" % (
                            data_url_filetype,
                            encoding,
                            output)
                        img = "![" + filename + "](" + data_path + ")"

                    text = '%s\n%s\n%s' % (
                        text[:m.start()], img, text[m.end():])

                except Exception as e:
                        err = str(e) + ' : ' + str(args)
                        return (
                            '<pre>Error : ' + err + '</pre>'
                            '<pre>' + content + '</pre>').split('\n')

            else:
                break
        return text.split("\n")
531329
private static String[] executeShellCommand(String[] command)
  throws IOException {
    String groups = Shell.execCommand(command);
    StringTokenizer tokenizer = new StringTokenizer(groups);
    int numOfTokens = tokenizer.countTokens();
    String[] tokens = new String[numOfTokens];
    for (int i=0; tokenizer.hasMoreTokens(); i++) {
      tokens[i] = tokenizer.nextToken();
    }

    return tokens;
  }
905982
public static String execute(final boolean withResponse, final String... command)
		throws IOException
	{
		final List<String> commands = new ArrayList<>();
		commands.add("bash");
		commands.add("-c");
		commands.addAll(Arrays.asList(command));
		String response = "";

		final ProcessBuilder pb = new ProcessBuilder(commands);
		pb.redirectErrorStream(true);

		final Process shell = pb.start();

		if (withResponse)
		{
			try (InputStream shellIn = shell.getInputStream())
			{
				response = toString(shellIn);
			}
		}

		return response;
	}
1206495
def run_command(self, input_file, output_dir=None):
        
        base_name = os.path.basename(input_file)
        name, suffix = base_name.split('.', 1)
        output_file = '{}{}.tif'.format(name, self.split_pattern)
        if output_dir:
            output_file = os.path.join(output_dir, output_file)
        return ['bfconvert', input_file, output_file]
345405
function runCommand(command) {
    return new Promise((resolve, reject) => {
        utils.logInfo(`Command: ${command}`);
        childProcess.exec(command, (error, stdout, stderr) => {
            // If exec returns content in stderr, but no error, print it as a warning.
            // If exec returns an error, reject the promise.
            if (error) {
                reject(error);
                return;
            } else if (stderr) {
                utils.logInfo(stderr);
            }
            resolve(stdout);
        });
    });
}
1179433
private void execute(String command) throws XAException {
    try {
      connection.createStatement().execute(command);
    } catch (SQLException sqle) {
      throw mapXaException(sqle);
    }
  }
1182598
public static List<String> cmd(String command) throws IOException, InterruptedException {
        return cmd(command.split(" "));
    }
422452
public static StringBuffer runCommand(String[] cmd) {
    StringBuffer retval = new StringBuffer(MAX_OUTPUT_LENGTH);
    Process p;
    try {
      p = Runtime.getRuntime().exec(cmd);
      InputStream tmp = p.getInputStream();
      p.waitFor();
      int c;
      while ((c = tmp.read()) != -1)
        retval.append((char) c);
    } catch (IOException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    return retval;
  }
807614
public void runScript(String configFileName) 
	{
		int lineNum = 0;
		try {
	    BufferedReader in = new BufferedReader(new FileReader(configFileName));
	    String line;
	    while ((line = in.readLine())!=null) {
				lineNum++;
				if (!line.startsWith("#")) {
					String command = null;
					List args = new ArrayList();
					StringTokenizer tok = new StringTokenizer(line);
					if (tok.hasMoreTokens()) {
						command = tok.nextToken();
					}
					while (tok.hasMoreTokens()) {
						args.add( tok.nextToken() );
					}
					if (command!=null) {
						if (echoCommands) System.out.println("exec: "+line);
						execCommand(command,args);
					}
				}
			}
		} catch (Exception e) {
			System.out.println("Error: "+configFileName+" line "+lineNum+": "+e.toString());
			e.printStackTrace();
			return;
		}
	}
551861
public static boolean runCommand(final Process p, final OutputStream output) {
        return runCommand(p, output, output, new ArrayList<String>());
    }