Sponsored Content
Full Discussion: UNIX exit code 11
Top Forums UNIX for Dummies Questions & Answers UNIX exit code 11 Post 302905003 by bakunin on Monday 9th of June 2014 05:21:40 AM
Old 06-09-2014
Quote:
Originally Posted by msol
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:

Code:
#!/bin/sh

i=125

# ... arbitrary code ....

exit $i

Run this and query the exit code:

Code:
# /path/to/script ; echo $?
125

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.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

All about exit code

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)
Discussion started by: cdin2
2 Replies

2. Programming

Exit Code in HP-UX KSH.

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)
Discussion started by: mbb
3 Replies

3. UNIX for Dummies Questions & Answers

Where can I find a list of exit codes? (Exit code 64)

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)
Discussion started by: jkuchar747
3 Replies

4. Shell Programming and Scripting

where can I get exit code meanings?

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)
Discussion started by: speedieB
1 Replies

5. Shell Programming and Scripting

problem with exit code when piping

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)
Discussion started by: bitoffish
4 Replies

6. UNIX for Dummies Questions & Answers

How to capture exit code for a bg job

If I execute a job in background (in ksh or bash), how would I capture the exit code for that job? Thanks, - CB (1 Reply)
Discussion started by: ChicagoBlues
1 Replies

7. Shell Programming and Scripting

exit in unix

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)
Discussion started by: Muthuraj K
3 Replies

8. Shell Programming and Scripting

exit from unix

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)
Discussion started by: panyam
2 Replies

9. Shell Programming and Scripting

Exit code from piping in unix shell script

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)
Discussion started by: sonu_pal
8 Replies

10. Shell Programming and Scripting

Exit code

can anyone tell what the exit status - 137 belongs in unix shell scripting. (3 Replies)
Discussion started by: ramkumar15
3 Replies
Tcl_Exit(3)						      Tcl Library Procedures						       Tcl_Exit(3)

__________________________________________________________________________________________________________________________________________________

NAME
Tcl_Exit, Tcl_Finalize, Tcl_CreateExitHandler, Tcl_DeleteExitHandler, Tcl_ExitThread, Tcl_FinalizeThread, Tcl_CreateThreadExitHandler, Tcl_DeleteThreadExitHandler - end the application or thread (and invoke exit handlers) SYNOPSIS
#include <tcl.h> Tcl_Exit(status) Tcl_Finalize() Tcl_CreateExitHandler(proc, clientData) Tcl_DeleteExitHandler(proc, clientData) Tcl_ExitThread(status) Tcl_FinalizeThread() Tcl_CreateThreadExitHandler(proc, clientData) Tcl_DeleteThreadExitHandler(proc, clientData) ARGUMENTS
int status (in) Provides information about why the application or thread exited. Exact meaning may be platform-spe- cific. 0 usually means a normal exit, any nonzero value usually means that an error occurred. Tcl_ExitProc *proc (in) Procedure to invoke before exiting application. ClientData clientData (in) Arbitrary one-word value to pass to proc. _________________________________________________________________ DESCRIPTION
The procedures described here provide a graceful mechanism to end the execution of a Tcl application. Exit handlers are invoked to cleanup the application's state before ending the execution of Tcl code. Invoke Tcl_Exit to end a Tcl application and to exit from this process. This procedure is invoked by the exit command, and can be invoked anyplace else to terminate the application. No-one should ever invoke the exit system procedure directly; always invoke Tcl_Exit instead, so that it can invoke exit handlers. Note that if other code invokes exit system procedure directly, or otherwise causes the application to terminate without calling Tcl_Exit, the exit handlers will not be run. Tcl_Exit internally invokes the exit system call, thus it never returns control to its caller. Tcl_Finalize is similar to Tcl_Exit except that it does not exit from the current process. It is useful for cleaning up when a process is finished using Tcl but wishes to continue executing, and when Tcl is used in a dynamically loaded extension that is about to be unloaded. On some systems Tcl is automatically notified when it is being unloaded, and it calls Tcl_Finalize internally; on these systems it not nec- essary for the caller to explicitly call Tcl_Finalize. However, to ensure portability, your code should always invoke Tcl_Finalize when Tcl is being unloaded, to ensure that the code will work on all platforms. Tcl_Finalize can be safely called more than once. Tcl_ExitThread is used to terminate the current thread and invoke per-thread exit handlers. This finalization is done by Tcl_Final- | izeThread, which you can call if you just want to clean up per-thread state and invoke the thread exit handlers. Tcl_Finalize calls | Tcl_FinalizeThread for the current thread automatically. Tcl_CreateExitHandler arranges for proc to be invoked by Tcl_Finalize and Tcl_Exit. Tcl_CreateThreadExitHandler arranges for proc to be invoked by Tcl_FinalizeThread and Tcl_ExitThread. This provides a hook for cleanup operations such as flushing buffers and freeing global memory. Proc should match the type Tcl_ExitProc: typedef void Tcl_ExitProc(ClientData clientData); The clientData parameter to proc is a copy of the clientData argument given to Tcl_CreateExitHandler or Tcl_CreateThreadExitHandler when the callback was created. Typically, clientData points to a data structure containing application-specific information about what to do in proc. Tcl_DeleteExitHandler and Tcl_DeleteThreadExitHandler may be called to delete a previously-created exit handler. It removes the handler indicated by proc and clientData so that no call to proc will be made. If no such handler exists then Tcl_DeleteExitHandler or Tcl_DeleteThreadExitHandler does nothing. Tcl_Finalize and Tcl_Exit execute all registered exit handlers, in reverse order from the order in which they were registered. This | matches the natural order in which extensions are loaded and unloaded; if extension A loads extension B, it usually unloads B before it | itself is unloaded. If extension A registers its exit handlers before loading extension B, this ensures that any exit handlers for B will | be executed before the exit handlers for A. | Tcl_Finalize and Tcl_Exit call Tcl_FinalizeThread and the thread exit handlers after the process-wide exit handlers. This is because | thread finalization shuts down the I/O channel system, so any attempt at I/O by the global exit handlers will vanish into the bitbucket. KEYWORDS
callback, cleanup, dynamic loading, end application, exit, unloading, thread Tcl 8.1 Tcl_Exit(3)
All times are GMT -4. The time now is 03:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy