We have a batch Unix process that runs during the day and it is getting an exit code 11 from Unix.
I sense a slight misunderstanding here and before we go further i want to clear it up: "exit codes" are the result of a system call which ends a program and sets a certain exit code. It is common that an exit code of "0" indicates success and any non-zero exit code describes some or the other error condition. What this error condition might be is not standardized, so one program might give back "2" for "for not found" and another for something different.
The bottom line here is: not "UNIX gives back an exit code" but the application sets it itself upon exiting. UNIX just reports it. You could easily write a shell script yourself which sets any arbitrary exit code by using the "exit" keyword with some (signed short short) integer:
Run this and query the exit code:
You could enter any value -127-+127 and get the respective result. Therefore you need to consult the documentation of your application and find out what exit code "11" means. This depends entirely on the application you use and could be anything.
Hi,
I am working on Solaris 8 and the "intro" man page says, "Upon termination, each command returns two bytes of status, one supplied by the system and given the cause for termination, and (in the case of 'normal' termination) one supplied by the program. The former byte is 0 for normal... (2 Replies)
In one of my programs another process is called using the system command e.g.
lv_error = system("myproc");
where lv_error is declared as an int.
myproc would be returning 0 for success and 1 for failure. e.g.
if (success)
{
return(0);
}else{
return(1);
}
When the return code... (3 Replies)
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
I'm investigating strange behaviour on two boxes (Sun OS 5.10 and AIX 5.1) in ksh
have used $? to get exit codes returned:-
137 and 34
where can I find what these mean?
thank you (1 Reply)
i am writing a script to perform some mysqldumps and gzip them. The problem I am running into is that if the user specifies a database that doesn't exist, the error the mysql engine produces is still piped into gzip, and the exit code returned is 0. If I don't pipe into gzip, an exit code... (4 Replies)
I am fixing a production issue. I am running out some problems with the exit command.
This is how the code was in production
if ; then
echo 1 > $tmp/b1stat
exit 1
else
echo 0 > $tmp/b1stat
fi
I wanted to check for another condition and set a value 3 to the... (3 Replies)
Hi All,
How can i exit from "unix"?. Looks silly , but still , i logged in to the unix box , then i did a "su - other user" , then " su - other user" , and i end up in the unix as a some 10th user. If i exist i will come to the previous user/account. I want to exit from unix in a single shot.
... (2 Replies)
Hi ,
I have following code in my shell script :
"$TS_BIN/tranfrmr" "${TS_SETTINGS}/tranfrmr_p1.stx" "${TS_LOGS}/tranfrmr_p1.err" | (
"$TS_BIN/cusparse" "${TS_SETTINGS}/cusparse_p2.stx" "${TS_LOGS}/cusparse_p2.err" | (
"$TS_BIN/tsqsort" "${TS_SETTINGS}/srtforpm_p3.stx"... (8 Replies)
can anyone tell what the exit status - 137 belongs in unix shell scripting. (3 Replies)
Discussion started by: ramkumar15
3 Replies
LEARN ABOUT ULTRIX
_exithandle
exit(3C) Standard C Library Functions exit(3C)NAME
exit, _exithandle - terminate process
SYNOPSIS
#include <stdlib.h>
void exit(int status);
void _exithandle(void);
DESCRIPTION
The exit() function terminates a process by calling first _exithandle() and then _exit() (see exit(2)).
The _exithandle() function calls any functions registered through the atexit(3C) function in the reverse order of their registration. This
action includes executing all finalization code from the .fini sections of all objects that are part of the process.
The _exithandle() function is intended for use only with _exit(), and allows for specialized processing such as dldump(3C) to be performed.
Normal process execution should not be continued after a call to _exithandle() has occurred, as internal data structures may have been torn
down due to atexit() or .fini processing.
The symbols EXIT_SUCCESS and EXIT_FAILURE are defined in the header <stdlib.h> and may be used as the value of status to indicate success-
ful or unsuccessful termination, respectively.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO exit(2), atexit(3C), dldump(3C), attributes(5), standards(5)SunOS 5.10 1 Mar 2004 exit(3C)