Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Application Security Testing: An Integral Part of DevOps

Return Values from Java to Unix

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?

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.



Thanks for your registration, follow us on our social networks to keep up-to-date