![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running shell script from java | samshaw | Shell Programming and Scripting | 2 | 04-25-2009 11:34 PM |
| How to call Java by using shell script | aaabbb123123 | Shell Programming and Scripting | 2 | 08-21-2008 02:02 AM |
| Unix Shell script vs Java | navojit dutta | Shell Programming and Scripting | 13 | 08-11-2007 09:18 PM |
| Running Shell Script from Java | Asty | Shell Programming and Scripting | 3 | 08-14-2006 09:08 AM |
| run java using shell script | inpavan | UNIX for Dummies Questions & Answers | 1 | 03-14-2002 10:38 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
run shell script in java?
hi,
how to run shell script in java? i have script a.sh which takes 1 argument as input and returns exit code integer. how to handle it in java. should i have to invoke process to execute it and then wait til it completes ? please explain with code thanks |
|
||||
|
haven't done this in a while, but I think it's:
Code:
try {
java.lang.Process process = java.lang.Runtime.getRuntime().exec("command args");
int retCode = process.exitValue();
}
catch (Exception e) { }
hth, dv |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|