This language bar is your friend. Select your favorite languages!
Select your favorite languages :
- Or search :
int system("x a b");
This spawns a shell and returns, when the child process has exited.
spawnProcess([x, "a", "b"]);
There are many ways to do that (with pipes, collecting output, etc...). The documentation is useful.
exec(`${x} a b`);
This assumes a node.js environment.
See the documentation for examples on how to capture output, and equivalent synchronous commands.
See the documentation for examples on how to capture output, and equivalent synchronous commands.
var b = new ProcessBuilder(of("x", "a", "b"));
try {
b.start().waitFor();
} catch (Exception e) {
throw new RuntimeException(e);
}