Questions tagged [exit-code]

An exit code is signaled by a program on termination to indicate if it completed successfully, or, if it did not, what sort of failure condition occurred.

exit-code
Filter by
Sorted by
Tagged with
2 votes
1 answer
2k views

How to test the exit status from IPC::Run3

I'm trying to test the Perl module IPC::Run3 but having difficulty in checking whether a command is failed or successful. I know that IPC::Run3 issues an exit code if something is wrong with its ...
PedroA's user avatar
  • 1,895
0 votes
0 answers
547 views

How to shutdown application and then read exit code

I want my WPF application to shutdown and restart in different ways. To do this I am using: Application.Current.Shutdown(exitCode); this is easy. But how to read the exit code when restarting? I ...
Patrick's user avatar
  • 3,214
4 votes
1 answer
940 views

Python3: Exception or return code when resource limit exceeded?

I am running python 3.4.3. I have a subprocess that may run a long time, or generate files that are too large. I have this code. def setlimits(): if DEBUG: print("Setting resource limit ...
Jim Hefferon's user avatar
-1 votes
1 answer
79 views

Can we write loops/conditions/block of code in a defer?

Hi I am new to golang, I use defer to close my result set like this. defer res.Close() I would like to check whether res is nil or not before calling res.Close(). I have below code block in the ...
Jishnu Prathap's user avatar
1 vote
3 answers
4k views

Return messages instead of exit code for msi in powershell

Is there a way I could make msiexec return the error/success message instead of the default exit code? for instance: msiexec /i "D:/path/installer.msi" might return 1603, and referencing the lookup ...
George's user avatar
  • 6,026
0 votes
1 answer
414 views

STS Java exit code 13

I've reviewed previous answers for this type of question, and have tried to act according to the answers given but still come up with this problem. I've deleted previous versions of Eclipse and ...
Hawwa's user avatar
  • 37
0 votes
2 answers
3k views

Tomcat restarts with errors (exit 143), runs and then fails after time

This is my first time asking a question on Stack Overflow. I recently configured an Ubuntu 16.04 virtual private server to host a web application. I run ngnix on a Tomcat server that reads and writes ...
Jado's user avatar
  • 1
2 votes
0 answers
383 views

Are there WIN32 exit codes that roughly correspond to POSIX exit codes?

I'm writing a python application that runs in a cross platform environment. Every once in awhile I have to use a sys.exit to stop the program when something goes wrong (or if something goes right). I'...
Erotemic's user avatar
  • 5,068
0 votes
1 answer
952 views

What's the best way to preserve an exit code or assign it to a variable with Bash?

I'm trying to save the exit code from running psql in a shell script. Assuming the psql command right before this snippet was bad, I'm expecting this snippet to return anything but 1, which it ...
simplycoding's user avatar
  • 2,883
29 votes
8 answers
42k views

ERROR: resizing partition e2fsck failed with exit code 8

I'm new to android studio. When I try to run my first programme in android studio on the emulator, I get this error. I have searched through other comments and have also tried decreasing my build....
transmitteam's user avatar
4 votes
2 answers
3k views

How does echo $? work?

I am writing some PowerShell scripts to do some build automation. I found here that echo $? returns true or false depending on previous statement. I just found that echo is alias for Write-Output. ...
VivekDev's user avatar
  • 23.3k
0 votes
1 answer
191 views

Linker command fail, exit code 1 with Flurry

When I import Flurry as per the instructions here: https://developer.yahoo.com/flurry/docs/integrateflurry/ios/ I get the following error after following all the instructions and trying to run: I ...
MartynE23's user avatar
0 votes
0 answers
351 views

Conditional logic in Makefile from Grep exit codes

I'm writing a connivence function in a Makefile and I'm having some trouble capturing and making decisions returned by a grep status code. I'm aware that a command that exits with a non-zero status ...
James Taylor's user avatar
  • 6,298
0 votes
5 answers
270 views

how to handle server being down when piping curl to grep

I am trying to write a script to query a web server API and check for a value but I am having trouble trying to figure out how to best go about it. So far what I am doing is using curl to get a ...
user2328273's user avatar
1 vote
1 answer
8k views

Fails on setup of SQL Server Express silent Installation with Exit Codes: 0x84B40003 and 0x84C40013

I'm trying to made a setup using Installshield 2015 with SQL Server Express silent install, I set "specify command line for the application" with these values: SQLEXPR_x86_ENU.exe /QS /FEATURES=...
A.nikfar's user avatar
10 votes
3 answers
6k views

What should my program's exit code be if I caught a signal?

I think I may have been doing this wrong for a while, because we just switched to systemd and it's considering my cleanly-killed process to have ended unsuccessfully. Basically I listen for SIGHUP, ...
Lightness Races in Orbit's user avatar
0 votes
2 answers
1k views

Bash IF exit code redirect errors

I'm writing a bash script right now that has a statement to check if a directory contains stuff. Right now, the code is if [ "$(ls -A $APPLICATIONS)" ]; then do something else do something ...
Felix Jen's user avatar
  • 154
0 votes
1 answer
5k views

Java started but returned with exit code 13 [duplicate]

I am trying to install GemFire but I am running into a java error which I assume is because I have multiple versions of java installed. I started with only JRE 6 but then I installed JDK 8 and ...
user avatar
1 vote
1 answer
2k views

Tar exit code 0 despite error "Cannot open: No such file or directory"

I'm creating an archive from within a script and would like to perform some actions if this fails for whatever reason. The code to check the error case looks something like this: if ! sudo tar -zcf "...
suamikim's user avatar
  • 5,148
0 votes
0 answers
53 views

Same program, same parameters, different locations and different exit codes

I've encountered an unexpected problem with an .exe I use for my inter-process communication. It seems to work in desktop directory but it fails and gives a weird unset in its code exitcode in my ...
SebOlens's user avatar
  • 519
1 vote
2 answers
101 views

How do I run certain code/function before the program exits in D?

Suppose I have loop which awaits for user input. If user presses Ctrl+C the program exits normally. However, I'd like to do a couple of things before exit. Is it possible to run a function once Ctrl+C ...
orion3's user avatar
  • 9,855
1 vote
1 answer
928 views

DTExec.exe CheckFile and Validate fails

I'm trying to execute a dtsx script using DTExec.exe as part of the batch process. The following command line script works: "C:\Program Files\Microsoft SQL Server\130\DTS\Binn\DTExec.exe" -File "\\\\...
weiji14's user avatar
  • 487
1 vote
1 answer
4k views

Cudafy The thread has exited with code 259

I have testing some GPU computing samples with cudafy I have code which compute/creta colection of data, and each loop i want do on every object in collection some GPU operation CODE: public ...
kronas's user avatar
  • 71
1 vote
1 answer
1k views

How can I get MStest to return a non-zero exit code when failing?

I am trying to test some .NET Core code with MSTest, and I am discovering that the test suite returns an exit code of zero even when there are failing tests. I am able to reproduce the problem using ...
Jonny Appleseed's user avatar
-3 votes
1 answer
199 views

system("tar xzf DirName/tarFile.tar DirNameInsideTar/FileName") in perl fails and returns -1

What does tar exit code of -1 means? I am using the command system("tar xzf DirName/tarFile.tar DirNameInsideTar/FileName") to untar from perl script. I am trying to untar around 1000 tar files ...
Pranav's user avatar
  • 1
12 votes
2 answers
24k views

What does ExitCode -1073741502 mean?

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 ...
AntonioC's user avatar
  • 447
2 votes
2 answers
988 views

How can i check the exit code of individual process running in parallel executed by GNU Parallel

I am having an array in linux shell script. Array contains list of commands in bash shell script. For instance : args =( "ls","mv /abc/file1 /xyz/file2","hive -e 'select * from something'" ) Now I ...
npaluskar's user avatar
0 votes
1 answer
72 views

get exit code of a background process that completed a while ago

This may not be a completely new topic but I ran into a little bit odd situation. I'm processing about 1000 files in a loop by kicking off a script in background. I want to take some actions on the ...
chemicalkt2's user avatar
48 votes
6 answers
21k views

How can I display a 'naked' error message in PowerShell without an accompanying stacktrace?

How can I write to standard error from PowerShell, or trap errors such that: An error message is displayed as an error (truly writing to standard error so that TeamCity and Octopus see it as an error)...
Peter Seale's user avatar
  • 4,925
0 votes
1 answer
152 views

How to re-develop the sys-function "system()" cleanly?

I have to develop my own C function system. To do that, I use the call-system fork to create a child process and it has to execute the command given to system, calling exec. What I've wrote seems to ...
JarsOfJam-Scheduler's user avatar
0 votes
3 answers
83 views

Exiting program for any input that is not a list

My goal is to create a little program that converts angle from radiant to degree and vice-versa. I need the program to close with no error message from python if the user enters the information to ...
B.gho's user avatar
  • 55
0 votes
1 answer
827 views

How to solve linker command failed with exit code 1 (use -v to see invocation)

i am getting this error when i am performing archive for my app. linker command failed with exit code 1 (use -v to see invocation) can any one help me to solve this. Thanks
Harry Saggu's user avatar
7 votes
1 answer
3k views

C# console application: Main method return value VS Application.ExitCode

I am writing a console program for windows task scheduler to run. My Main() method has a return type of int and I return different numbers when exiting to indicate the result of execution, which I can ...
Lionet Chen's user avatar
1 vote
0 answers
221 views

Random exitcode 1 after refreshing, using php proc_open to execute node & npm

I really can't figure this one out. What could be causing my Wamp localhost to occasionally throw an error (exitcode 1) when I refresh the page? Same script, same execution... but for some reason ...
chamberlainpi's user avatar
60 votes
5 answers
79k views

Execute bash command in Node.js and get exit code

I can run a bash command in node.js like so: var sys = require('sys') var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } exec("ls -la", function(err, ...
Marc Bacvanski's user avatar
0 votes
2 answers
242 views

In a pipe, how can a program downstream get the exit code of a program upstream after end-of-input?

I wrote a program which waits for data on standard input, writes it to a temporary location and moves it to a user-specified location upon end-of-input. By this, I want to enable pipelines like ...
akraf's user avatar
  • 3,132
0 votes
1 answer
1k views

What is a good way to define and declare job dependencies on rundeck?

On rundeck workflow scheduling, I want to configure a workflow like this. Job Step 1 : returns status "success" Job Step 2 : checks return status of {Job Step 1} (as "success") and proceeds Am ...
Naveen Karnam's user avatar
0 votes
0 answers
30 views

bash - getting exit codes from 2 called programs that work asynchronously together [duplicate]

I know how to get exit code from last called program. But how can I check exit codes in the following scenario prog1 & prog2 & while [ true ]; do # main loop while [ condition1 ]; do ...
user avatar
0 votes
1 answer
148 views

the reason for my program's exit [closed]

I have a python script running in background with nohup ./myprogram.py 1>console.out &. The program is constantly logging to some log file and the processing is long. After running for 2 days(...
Junchao Gu's user avatar
  • 1,845
0 votes
1 answer
102 views

WxPython Exit Code 139 with Form Window

So this is a pretty basic program but for some reason it keeps crashing wtih exit code 139. I've looked online at the error code and it has to do with memory management but a basic form with a few ...
user3667623's user avatar
0 votes
2 answers
634 views

redirect command to a variable or a file based on its exit code bash script?

I want to redirect stderr or stdout of a command to a file or a variable, based on exit code of the command. I.e, if exit code is zero, then I would redirect stdout to file, otherwise I would redirect ...
Starc's user avatar
  • 117
10 votes
3 answers
8k views

Test Environment.Exit() in C#

Is there in C# some kind of equivalent of ExpectedSystemExit in Java? I have an exit in my code and would really like to be able to test it. The only thing I found in C# is a not really nice ...
Antiohia's user avatar
  • 1,192
0 votes
1 answer
451 views

Catch invalid password on Sudo

Is there a way to trap/catch a invalid password when you use sudo? Basically I want to return a specific exit code if the sudo password is invalid. I don't want to avoid sudo or get around it, I just ...
this guy's user avatar
3 votes
1 answer
2k views

Shell script not recording Java exit status on failure

I am trying to write a shell script that records the exit status of a Java program. The script should simple launch a Java app, and if the Java app doesn't run for some reason, the shell script should ...
Seanimus's user avatar
  • 503
2 votes
2 answers
2k views

Get exit code of a piped background process

someCommand 2>&1 | grep pattern & How do I get the exit status of someCommand? PIPESTATUS doesn't work because it's a background process. I've found this link and it seems to work but ...
NPS's user avatar
  • 6,133
0 votes
2 answers
684 views

how to catch installation progress and return-value from an installer in vb.net

I'm developing a windows application (using vb.net) that can install various versions of runtimes like vc++, Direct X, .net frameworks etc on a PC. My program must be able to to run the runtime ...
Xlam's user avatar
  • 133
5 votes
2 answers
6k views

Get exit code when piping into grep -v [duplicate]

I have a script like this: #!/bin/sh echo "hello" echo "goodbye" exit 1 When I run it on its own, I get the failed exit code as I expect. $ ./fail.sh hello goodbye $ echo $? 1 However, when I run ...
limp_chimp's user avatar
  • 14.1k
1 vote
2 answers
2k views

slurm: write exit code or job status into logfile when finished (completed or failed)

I need to make sure that all commands in my script finished successfully (returned 0 status). That's why my slurm script includes following lines: set -e set -x Now I would like the exit status of ...
Perlnika's user avatar
  • 4,916
0 votes
1 answer
792 views

Bash script always returns 0 even with explicit exit 1

Problem: I am trying to create an hg pre-commit hook. The commit always succeeds even if the only thing in the bash script invoked by the hook is "exit 1". What I've Tried: -Wrote a bash script ...
Richard Hammond's user avatar
11 votes
4 answers
23k views

How to get test command return code in the shell?

Is it any better way to get return code from command in one line. eg: $ test $(ls -l) ||echo 'ok' -bash: test: too many arguments ok the above script have error in test command, because it seems ...
Robber Pen's user avatar
  • 1,043

1
9 10
11
12 13
22