Sponsored Content
Top Forums Shell Programming and Scripting Return value from UNIX to JAVA Post 302334769 by cbkihong on Thursday 16th of July 2009 11:36:26 AM
Old 07-16-2009
According to the javadoc, Runtime.exec() returns a Process object that allows you to get information about the process. I found the exitValue() method and that is likely what you need.

Process (Java Platform SE 6))
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unix return codes

Suppose I have a script which is monitoring a directory whenever a file drops in that directory,it sends alert say I want to write a return code for the above script which on successful execution of script gives a return value Based on return code , I want to do initiate some jobs in other... (1 Reply)
Discussion started by: abhib45
1 Replies

2. UNIX for Dummies Questions & Answers

How do you Sum UNIX return codes

Hi, I know how to read a return code after executing a single command. "echo $?". But I do not know how to sum the return code for a group of commands. If I string 3 commands together and I do an echo $? all I get is the retunr code for the last command. Example below: ... (3 Replies)
Discussion started by: z1tt45uuprs7
3 Replies

3. Shell Programming and Scripting

return code of a unix command

How to find out whether the command I executed is successful or unsuccessful(at commandlinet) Eg: say i execute the following command at command line rm * How do i find out whether my previous command is a success or failure. Thankyou. Best Regards, Ram. (1 Reply)
Discussion started by: ramky79
1 Replies

4. UNIX for Dummies Questions & Answers

Return value from oracle to unix shell

Hi , i have written a shell scipt to call a procedure and get the value back from procedure.But i am facing the issue like #!/bin/sh returnedvalue=`sqlplus -s userid/pass<<EOF set serveroutput on; exec pass($1) set serveroutput off; EXIT; EOF` flag=`echo $returnedvalue ` echo "$flag"... (2 Replies)
Discussion started by: ravi214u
2 Replies

5. Shell Programming and Scripting

return code of multiple java process

Hi, I have a unix shell script which is launching multiple java processes by calling a java class in a loop, but each time with a different set of parameters. Now I have to use the return code from each process in the script later. but how do i obtain the return code from each process... (1 Reply)
Discussion started by: rama354
1 Replies

6. Shell Programming and Scripting

How to capture return value from java in shell scripting

Hi All, My shell script will call a java component with some arguments , the java component returns a string value to the shell script. How to assign the return value to the shell variable. Here is the sample code. In my shell script i am calling the java as fallows. --exporting... (1 Reply)
Discussion started by: rajeshorpu
1 Replies

7. Shell Programming and Scripting

Problem with call of Java Programm & return code handling & output to several streams.

Hello Everybody, thanks in advance for spending some time in my problem. My problem is this: I want to call a java-Programm out of my shell skript, check if die return code is right, and split the output to the normal output and into a file. The following code doesn't work right, because in... (2 Replies)
Discussion started by: danifunny
2 Replies

8. Shell Programming and Scripting

Unix Script - DB Return

Based on the earlier thread , I made the change for the oracle sequence next val from .sh script , X=$(sqlplus -s user/pswd << eod set heading off select etl.batch_sq.nextval from dual; eod) when I echo to check the value echo Batch_Id_$X I get the following result : Batch_Id_ 69... (3 Replies)
Discussion started by: Shanks
3 Replies

9. Shell Programming and Scripting

Unix return code example

Hi, Does anyone here can guide me to understand how is return code works in a parent-child relation with a simple example? I have a request to build the script with return code in a child script, but i want to understand how does child script can return a code to the parent, stated if its... (4 Replies)
Discussion started by: khchong
4 Replies

10. Programming

Need best forum site for java (as for unix its unix.com)

Hi All, Can anyone help me for knowing the java best side forums. where i will get a quick responce like here , as i am having lot of question. Thanks (1 Reply)
Discussion started by: aish11
1 Replies
jhat(1) 						      General Commands Manual							   jhat(1)

NAME
jhat - Java Heap Analysis Tool SYNOPSIS
jhat [ options ] <heap-dump-file> PARAMETERS
options Options, if used, should follow immediately after the command name. heap-dump-file Java binary heap dump file to be browsed. For a dump file that contains multiple heap dumps, you may specify which dump in the file by appending "#<number> to the file name, i.e. "foo.hprof#3". DESCRIPTION
The jhat command parses a java heap dump file and launches a webserver. jhat enables you to browse heap dumps using your favorite web- browser. jhat supports pre-designed queries (such as 'show all instances of a known class "Foo"') as well as OQL (Object Query Language) - a SQL-like query language to query heap dumps. Help on OQL is available from the OQL help page shown by jhat. With the default port, OQL help is available at http://localhost:7000/oqlhelp/ There are several ways to generate a java heap dump: * Use jmap -dump option to obtain a heap dump at runtime; * Use jconsole option to obtain a heap dump via HotSpotDiagnosticMXBean @ http://java.sun.com/javase/6/docs/jre/api/management/extension/com/sun/management/HotSpotDiagnosticsMXBean.html at runtime; * Heap dump will be generated when OutOfMemoryError is thrown by specifying -XX:+HeapDumpOnOutOfMemoryError VM option; * Use hprof @ http://java.sun.com/developer/technicalArticles/Programming/HPROF.html. NOTE: This tool is experimental and may not be available in future versions of the JDK. OPTIONS
-stack false/true Turn off tracking object allocation call stack. Note that if allocation site information is not available in the heap dump, you have to set this flag to false. Default is true. -refs false/true Turn off tracking of references to objects. Default is true. By default, back pointers (objects pointing to a given object a.k.a refer- rers or in-coming references) are calculated for all objects in the heap. -port port-number Set the port for the jhat's HTTP server. Default is 7000. -exclude exclude-file Specify a file that lists data members that should be excluded from the "reachable objects" query. For example, if the file lists java.lang.String.value, then, whenever list of objects reachable from a specific object "o" are calculated, reference paths involving java.lang.String.value field will not considered. -baseline baseline-dump-file Specify a baseline heap dump. Objects in both heap dumps with the same object ID will be marked as not being "new". Other objects will be marked as "new". This is useful while comparing two different heap dumps. -debug int Set debug level for this tool. 0 means no debug output. Set higher values for more verbose modes. -version Report version number and exit. -h Output help message and exit. -help Output help message and exit. -J<flag> Pass <flag> to the Java virtual machine on which jhat is run. For example, -J-Xmx512m to use a maximum heap size of 512MB. SEE ALSO
* jmap - Java Memory Map * jconsole - Java Monitoring and Management Console * hprof - Heap and CPU profiling tool @ http://java.sun.com/developer/technicalArticles/Programming/HPROF.html 05 Aug 2006 jhat(1)
All times are GMT -4. The time now is 03:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy