Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute Shell script

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hwo can I excute a unix shell Script in Java Code ??
 
Pretty easy. Here is a really simple example:
Code:
String shellCommand; /* Set your command here */
Runtime rt = Runtime.getRuntime();
rt.exec(shellCommand);
Note: You can do much more with this, such as retrieving and parsing the output of the command. This should be enough to get you started. Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top