Java, user input to the command line when using Runtime.getRuntime().exec(command);

Posted by user1557354 on Stack Overflow See other posts from Stack Overflow or by user1557354
Published on 2012-12-12T17:02:09Z Indexed on 2012/12/12 17:03 UTC
Read the original article Hit count: 141

Filed under:
|
|

I dont think this is possible, but I have been using:

Process p = Runtime.getRuntime().exec(command);

to run commands on the command line, but now I have come accross a situation where the command I am running part way through will ask for some user input, for example a username.

This can not be resolved by a argument to the command that is being exec, is there any way I can pass the username to the same command line instance and continue?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about command-line