File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Manishkumar Haria
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, the subject explains it all
 
Philip Pross
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic