wood burning stoves 2.0*
The moose likes Java in General and the fly likes Need to handle the interactive command using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need to handle the interactive command using java" Watch "Need to handle the interactive command using java" New topic
Author

Need to handle the interactive command using java

shital sonavane
Greenhorn

Joined: Jan 28, 2011
Posts: 20

Hi,
I want to handle the interactive command using java. Dont know how to do this.

For example i am executing command -su on linux machine. after this command execution we need to enter the password.
This is the example not the exact command.

Please suggest me the solution.

Thanks in advance.

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

You'll want a loop that reads a line from System.in and then processes that line.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need to handle the interactive command using java
 
Similar Threads
Read mail file using script
problem running SSH with JSP
Trapping of different shells like DOS,Unix
How to Run a command
Command line question