Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java Language
Expertise: Beginner
Jun 6, 2000

Return Values from Java to Unix

Question:
I am calling a java program from a Unix script and passing three parameters. Once the Java program is done, I want to return two values back to the Unix program from the Java program.

How do I return data back from a Java program to a Unix script?

Answer:
The simplest, and perhaps best, way to do this is to print the values to standard output and parse them in the script. It is normal for shell scripts to use the printed output of other programs in one way or another.

Another alternative is to write the values to a file. Other forms of interprocess communication can be used, but provide overly complicated solutions for the simple case of returning values to a script.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap