|
-
Need help for using Java program to setup Solaris 10 NIS+
Hello,
I am current try to write a JAVA program to setup and configure NIS+ on my Solaris 10 X86 machine.
However i had faced a problem that is how to capture or how to read the question from NIS+ script: "Is this information correct? (type 'y' to accept, 'n' to change) ".
Below is my code:
import java.io.BufferedReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
/**
*
* @author root
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String [] args) throws IOException {
String cmd1 = "/usr/lib/nis/nisserver -v -r -d" ;
String cmd2 = "doc.com." ;
Runtime run = Runtime.getRuntime();
Process pr = run.exec(cmd1+cmd2);
System.out.println(pr.exitCode());
BufferedReader buf = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line = "";
do {
System.out.println(line);
}while ((line=buf.readLine())!=null);
}
}
I hope any guys can help me to overcome this problem as soon as possible.
Thank you very much.
From,
java_newbie
Similar Threads
-
Replies: 1
Last Post: 08-15-2006, 03:20 PM
-
Replies: 1
Last Post: 05-13-2005, 06:46 AM
-
By Lori Piquet in forum Talk to the Editors
Replies: 114
Last Post: 10-10-2002, 06:01 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks