aspose file tools*
The moose likes I/O and Streams and the fly likes How to call a UNIX script froma java application on AIX (using Korn shell)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to call a UNIX script froma java application on AIX (using Korn shell)?" Watch "How to call a UNIX script froma java application on AIX (using Korn shell)?" New topic
Author

How to call a UNIX script froma java application on AIX (using Korn shell)?

Manishkumar Haria
Greenhorn

Joined: Oct 04, 2001
Posts: 3
I think, the subject explains it all
Philip Pross
Ranch Hand

Joined: Jan 17, 2001
Posts: 76
If your class is on the unix server
try
{
Process p = Runtime.getRuntime().exec("/bin/sh " +"di this");

try
{
p.waitFor();
}
catch (InterruptedException e)
{
System.out.println(e.getMessage() );
}
}
catch (IOException e)
{
System.out.println("erreur " + e.getMessage() );
}
Manishkumar Haria
Greenhorn

Joined: Oct 04, 2001
Posts: 3
Philip,
Thanks a lot for the tip.
Here's what I tried (almost similar to your tip) and it worked.


I just have one question about your tip: Does the string "di this" identify the script you are trying to execute?
Thanks again for the tip.
 
jQuery in Action, 2nd edition
 
subject: How to call a UNIX script froma java application on AIX (using Korn shell)?