exit-code

Auto exit Telnet command back to prompt without human intervention ^] quit close exit code 1

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 14:52:05
问题 I'm running telnet command on a host for a given port (which is open), it returns 0 (success). For trying telnet manually, I type the following command, then I press control+bracket i.e. ^] , then press Enter key, then I get to telnet> prompt, where if I type close or quit , it comes back to the $ prompt and seeing exit status of last command shows 0 for (success) as port 2878 is open (as per the telnet command's output). [vagrant@myvagrant /tmp] $ telnet `hostname` 2878 Trying 127.0.0.1...

Powershell Copy-Item Exit code 1

孤人 提交于 2019-12-07 11:33:25
I have a script with several files I'd like to copy and I do it more or less like so. Copy-Item xxx1 yyy1 -Force Copy-Item xxx2 yyy2 -Force Copy-Item xxx3 yyy3 -Force Copy-Item xxx4 yyy4 -Force and so on. Now I'd like this script to exit with 1 if any of the files was not copied. Thanks in advance What you're asking for is similar to the set -e option in bash , which causes a script to exit instantly in the event that a command signals failure (except in conditionals) [1] . PowerShell has no such option [2] , but you can emulate it: # Set up a trap (handler for when terminating errors occur).

What is the cause of JVM exit code 1073807364?

送分小仙女□ 提交于 2019-12-07 06:28:54
问题 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

Get the exitcode of the shell script in a “trap EXIT”

不羁岁月 提交于 2019-12-07 04:20:37
问题 I want to have a cleanup action in my Bash scripts, like this: #! /bin/bash set -eu trap 'echo "E: failed with exitcode $?" 1>&2' ERR true false Using $? came to mind as a natural choice, but this isn't the case. It always contains 0 . Is there any way that I can "spy" on the exitcode in the ERR trap? [Update:] I have no idea what I had tested before. This code works like a charm, so I'm leaving it here as a small and good example. 回答1: Your ( probably simplified ) example doesn't exhibit the

Where does the exit status go after trap/return?

扶醉桌前 提交于 2019-12-07 04:17:08
问题 I was playing around with using trap inside a function because of this question, and came up with this secondary question. Given the following code: d() { trap 'return' ERR false echo hi } If I run d , the trap causes the shell to return from the function without printing 'hi'. So far so good. But if I run it a second time, I get a message from the shell: -bash: return: can only `return' from a function or sourced script At first, I assumed this meant the ERR sig was happening twice: Once

What does ExitCode -1073741502 mean?

為{幸葍}努か 提交于 2019-12-07 02:15:12
问题 I'm using the GetExitCodeProcess API to determine the exit reason for a process. When my process fails, I get the error code -1073741502. How can this value be converted into a value that I could google for? Thank you. Edit: Well, 1073741502 appears on Google, but not -1073741502. Why does my error code have a minus? 回答1: Converted to hexadecimal, the value is 0xC0000142. Windows NTSTATUS values show that your error code is STATUS_DLL_INIT_FAILED which is: {DLL Initialization Failed}

How to set ExitCode in a VCL Forms Application

*爱你&永不变心* 提交于 2019-12-06 20:36:09
问题 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%

Meaning of Exit Code 11 in C?

狂风中的少年 提交于 2019-12-06 18:27:44
问题 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. 回答1: 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.

Is exit status observable behavior?

ε祈祈猫儿з 提交于 2019-12-06 18:26:14
问题 C 2018 5.1.2.3 6 says: The least requirements on a conforming implementation are: Accesses to volatile objects are evaluated strictly according to the rules of the abstract machine. At program termination, all data written into files shall be identical to the result that execution of the program according to the abstract semantics would have produced. The input and output dynamics of interactive devices shall take place as specified in 7.21.3. The intent of these requirements is that

How can I get powershell to return the correct exit code when called with the -File argument?

混江龙づ霸主 提交于 2019-12-06 17:27:31
问题 Powershell is returning a 0 exit code, when an error has occurred, if called with the -File argument. Which means my build is green when it shouldn't be :( For example: (in wtf.ps1) $ErrorActionPreference = "Stop"; $null.split() (cmd) powershell -file c:\wtf.ps1 You cannot call a method on a null-valued expression. At C:\wtf.ps1:3 char:12 + $null.split <<<< () + CategoryInfo : InvalidOperation: (split:String) [], ParentConta insErrorRecordException + FullyQualifiedErrorId : InvokeMethodOnNull