class envir {
public void run() throws IOException {
ProcessBuilder builder = new ProcessBuilder("bash");
builder.redirectInput(ProcessBuilder.Redirect.PIPE);
builder.redirectOutput(ProcessBuilder.Redirect.PIPE);
builder.redirectErrorStream(true);
Process process = builder.start();
System.out.println(process.getInputStream());
}
}
How do I make it so that I can send a string as input for my process builder to automate a cli (eg env python3) also using threads?
If you need more info please ask; I am bad at wording these questions.
Writer, e.g.new BufferedWriter(new OutputStreamWriter(process.getInputStream())), and write into it.