exit-code

How to get the numeric exit status of an exited docker container?

依然范特西╮ 提交于 2019-12-05 12:31:58
问题 When a container exits, docker ps -a shows its exit code (scroll $ docker run ubuntu bash -c "exit 1" CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c2c769c4b9ef ubuntu "bash -c 'exit 1'" 6 seconds ago Exited (1) 3 seconds ago happy_fermat How do I get the numeric exit code programmatically, without error-prone grep -ing and cut -ing? 回答1: Use docker inspect with templates: $ docker inspect c2c769c4b9ef --format='{{.State.ExitCode}}' 1 回答2: You can use echo : $ docker run debian bash

What is the cause of JVM exit code 1073807364?

£可爱£侵袭症+ 提交于 2019-12-05 10:19:00
I've built a RCP-based application, and one of my users running on Windows XP, Sun JVM 1.6.0_12 had a full application crash. After the app was running for two days (and this is not a new version or anything), he got the nice gray JVM force exit box, with exit code=1073807364. He was away from the machine at the time, and the only thing I can find near that time in the application logs was some communication with the database (SQL Server by way of Hibernate). There's no hs_ files or anything similar as far as I can tell. Web searching found a bunch of crash reports with that exit code in a

exiting functions in main

99封情书 提交于 2019-12-05 08:10:02
I am relatively new to Stackoverflow and Java, but I have a little experience in C. I liked the very clean way of C exiting the programs after a malfunction with the 'exit()' function. I found a similar function System.exit() in Java, what differs from the C function and when should I use a 'System.exit()' best instead of a simple 'return' in Java like in a void main function? Jigar Joshi System.exit() will terminate the jvm initilized for this program, where return; just returns the control from current method back to caller Also See when-should-we-call-system-exit-in-java ? System.exit()

How to capture the exit status of a shell command in Java?

我与影子孤独终老i 提交于 2019-12-05 04:35:46
I'm creating a Junit test file for my CSVreader. I'm reading the contents of CSV files and writing the contents into another file. I want to compare them using diff utility and I want to use the exit status of diff to know whether the contents are same or not. Generally $? gives the exit status but I don't know how to capture it and use it in my code. Can anyone help me in this regard? This is how my code looks boolean hasSameContents = false; command="diff "+mp.get("directory")+"/"+fileName+" "+mp.get("outdir")+"/"+fileName; p= Runtime.getRuntime().exec(command); p.waitFor(); After this I

Issue with Process Exited

拜拜、爱过 提交于 2019-12-05 03:23:26
lets say I have a process with the ID 1234. This process is running before my application runs. I have this code: Process app = Process.GetProcessById(1234); MessageBox.Show(app.MainWindowTitle); app.Exited += this.methodShowsMessageBox; Now, when I compile and run the app, it gets the process and shows the main window title. However when i close process 1234, the app.Exited does nto fire... why is this? And how would i get it to fire? Please note that the documentation states that EnableRaisingEvents must be set to true before this event will fire. By default, for performance reasons, the

Does Android care about exit status code passed to System.exit(…)?

六眼飞鱼酱① 提交于 2019-12-05 02:11:37
If I kill an Android app with System.exit(...) , does it matter what status code I pass? I couldn't find any documentation on whether Android just ignores it or whether certain ones lead to any error messages for example or have any other meaning. This is the exit code returned by the process when it finishes; Android however does not care, but know that the error code should never be higher then 255. Here is a list of standard exit codes - some process may use their own codes. 0 Clean Exit 1 General Error Catchall 2 Misuse of shell builtins 126 Command invoked execution error 127 Command not

How to set ExitCode in a VCL Forms Application

泄露秘密 提交于 2019-12-05 00:29:41
I can't get ExitCode to work for a VCL forms application. Here is my test application. It was created from the File / New menu in the Delphi 2007 IDE. The only change is that I added the line ExitCode := 42; at the end. program Test; uses Forms, Unit27 in 'Unit27.pas' {Form27}; {$R *.res} begin Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TForm27, Form27); Application.Run; ExitCode := 42; end. Now, when I run it from the command line, %ERRORLEVEL% doesn't get set: >.\Test.exe >echo %ERRORLEVEL% 0 I was expected the value in %ERRORLEVEL% to be 42, but it

Meaning of Exit Code 11 in C?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 23:57:13
What's the general meaning of an exit code 11 in C? I've looked around and can not find a definitive answer so I thought I would ask here. It comes when i try to add an element to a vector. Gilles 'SO- stop being evil' You didn't find a definitive answer because there isn't one. It's up to the author of the program to decide what exit codes they wish to use. Standard C only says that exit(0) or exit(EXIT_SUCCESS) indicate that the program is successful, and that exit(EXIT_FAILURE) indicates an error of some kind. (Returning a value from main is equivalent to calling exit with that value.) Most

Bash: One-liner to exit with the opposite status of a grep command?

做~自己de王妃 提交于 2019-12-04 22:18:16
How can I reduce the following bash script? grep -P "STATUS: (?!Perfect)" recess.txt && exit 1 exit 0 It seems like I should be able to do it with a single command, but I have a total of 3 here. My program should: Read recess.txt Exit 1 (or non-zero) if it contains a line with "STATUS: " of NOT "Perfect" Exit 0 if no such line exists (i.e. all "STATUS: " lines are "Perfect") The answer award goes to the tightest script. Thanks! Example files Program should have exit status 0 for this file: FILE: styles.css STATUS: Perfect! FILE: contour-styles.css STATUS: Perfect! Program should have exit

Exit code of traps in Bash

血红的双手。 提交于 2019-12-04 19:34:35
问题 This is myscript.sh : #!/bin/bash function mytrap { echo "Trapped!" } trap mytrap EXIT exit 3 And when I run it: > ./myscript.sh echo $? 3 Why is the exit code of the script the exit code with the trap the same as without it? Usually, a function returns implicitly the exit code of the last command executed. In this case: echo returns 0 I would expect mytrap to return 0 Since mytrap is the last function executed, the script should return 0 Why is this not the case? Where is my thinking wrong?