Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
Unix Shell with java Example
This
Example illustates how to run the Unix Shell Cmds
with a
Java Class.
public class NewTest {
/**
* @param args
*/
public static void main(String[]
args) {
System.out.println(" about
run");
String cmd =
"sh -c cat /appl/yourImport.fmt
/appl/yourImport2.fmt
>
/appl/yourImport3.cvs";
try {
Runtime runtime = Runtime.getRuntime();
runtime.exec("ksh -v
test.sh");
runtime.exec(cmd);
System.out.println(" about run
1111");
String[] args1
=
new String[]{"sh", "-c",
"ls | wc >out2"};
Process p = runtime.exec(args1);
System.out.println(" about
run 1122");
String[] args2 =
new String[]{"sh", "-c",
"cat /bin/yourImport1.fmt
/bin/yourImport2.fmt
> /bin/yourImport5.cvs"};
Process p1 =
runtime.exec(args2);
System.out.println(" about run");
}
catch(Exception e) {
e.printStackTrace();
}
}
}
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.