Forums Register Login

Runtime exec() multiple parameters

+Pie Number of slices to send: Send
I don't know if the header conforms to the actual question, but English is not my native tongue, if not; I'm sorry.

problem:
I execute a command, but when executed the terminal gives me a question to input my password, how do I do this?



???

Thanks
+Pie Number of slices to send: Send
You can write to the process using the Process' getOutputStream method.
+Pie Number of slices to send: Send
Also, you should probably use getInputStream() to read the question text from the process, as well as read any other output from the process. (Output from the process is input for you.)

You should probably read the classic article When Runtime.exec() won't, as it discusses many common problems with exec(). Note that it was written before JDK 1.5 came out, which included the ProcessBuilder class. ProcessBuilder is basically an improved version of exec(), which solves some problems and gives you more control over some aspects of the process. I recommend you use it instead of exec(). But the JavaWorld article will still be useful to you, as many of the old issues remain.
To do a great right, do a little wrong - shakepeare. twisted little ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2217 times.
Similar Threads
How to free CPU utilised?
regarding Runtime.exec()
Runtime.exec("c.bat")
Runtime.exec problem
On Runtime and Process
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:08:43.