Questions tagged [exitstatus]
78 questions
0
votes
1 answer
Windows inventory using python
Am trying to create inventory report for set of windows servers using following function. But, this function always fails ping test for all hosts, though am apple to ping a few of them cleanly from command line.
tried multiple combination, not able…

Lokesh Bhatt
- 3
- 1
0
votes
1 answer
shell script: incorrect exit status of executed command
I'd like to get exit status of the command passed as argument (to my sh script called a.sh).
I've tried:
#!/bin/sh
CMD="$@"
echo "arg passed CMD: $CMD"
($CMD) >/dev/null 2>&1
res=$?
echo "exit status: $res"
CMD="echo aaa | grep -q zzz"
echo "in…

Peter Butkovic
- 11,143
- 10
- 57
- 81
0
votes
1 answer
RunTime.exec does not return errors from the process
I have to develop an app that reads messages from whatsapp database.
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
…

user7396065
- 39
- 1
- 7
0
votes
2 answers
What's the exit status of a failed condition?
[ $var -eq $val ]
What will be the value of $? after the above condition/test if it fails? Can I assume that it will always be 1?
Edit: After reading answers I realized my question wasn't precise. I meant "will it be always 1 if no error occurs?".

NPS
- 6,003
- 11
- 53
- 90
0
votes
2 answers
C: main() returning an array always equals to 56
I wonder what happens when I play with the return value of the main function.
I found that if I return an array variable from main (which is supposed to be the exit status) and print the exit status in shell, the output is always 56. I wonder…

İhsan Cemil Çiçek
- 191
- 12
0
votes
1 answer
Exit status of a Command in Bash Scripting is always true
I'm trying to run a command ( gerrit query ) in bash and assign that to a variable.
I'm using this is a bash script file & I want to handle the case that if the command throws an error( i.e if the gerrit query fails), I should be able to handle the…

Jose
- 1,333
- 5
- 20
- 38
0
votes
4 answers
how to get exit status of thread
I am writing a perl script to get the exit status of each thread from the parent process. if i use join() i am not able to get the thread proper exit status.
how to capture the exit status of each thread from parent process ?
here is code
foreach…

shreeshail
- 59
- 6
0
votes
0 answers
Early call of waitpid does not collect exit status correctly
I am using the following code to fork a process and signal it to stop later.
#include
#include
#include
#include
#include
using namespace std;
sig_atomic_t stopFlag = 0;
void…

PowerGnom
- 37
- 6
0
votes
1 answer
Is there any reserved space form custom application error codes?
We need to define a few application specific error codes (exit status). Our use case: uninstaller si calling application to do online deactivation, which may fail for multiple reasons (no internet, internal server error,...). Is there any reserved…

Ondrej Galbavý
- 159
- 1
- 13
0
votes
1 answer
running external process from scala using sbt ! operator under Windows
I have the following two lines in my scala program
val success:Int = ("d:\\program.bat" !)
println("started "+success)
program.bat looks like this
@echo off
start "" "d:\notepad.exe"
echo DONE
the program actually starts tomcat server, but it is…

misiek
- 121
- 7
0
votes
3 answers
Is there a succint way to test exit status of a set of commands in bash?
I have a simple script to pull data from a remote server as a process generates it using rsync:
while :
do
rsync -avz --remove-source-files -e ssh me@remote:path/to/foo* ./
rsync -avz --remove-source-files -e ssh me@remote:path/to/bar* ./
…

mgilson
- 300,191
- 65
- 633
- 696
-1
votes
1 answer
bash script exits with zero status even after kill signal
I keep getting zero status even after interrupting the script.
The first script
#!/bin/bash
## call the backup script
/usr/local/bin/backup 2>&1 >/dev/null
echo $?
backup
#!/bin/bash
exitscript() {
rm -f $LOCKFILE
echo "Script Status: $1 | tee…

Technas
- 17
- 5
-1
votes
1 answer
Exit status -1 from a Linux shell script
I have some Unix shell scripts in one of our servers and I have written a Java program using Spring Boot which is deployed in another application server.From my Spring Boot application, I am remotely executing the shell script at the other server.…

Anirban
- 925
- 4
- 24
- 54
-1
votes
1 answer
exit code: -1 on codeforces
I submitted a code on codeforces and on the 11th test case i got this-
Test: #11, time: 2000 ms., memory: 0 KB, exit code: -1, checker exit code: 0, verdict: TIME_LIMIT_EXCEEDED
Input
999999994 108004280
What does exit code: -1 signify here?

Anshul Agrawal
- 1
- 1
-2
votes
2 answers
C++ error: "undefined reference to cnt(int) collect2: error: ld returned 1 exit status
When I compile this C program, I get an error:
In function `main': maxcount.cpp:(.text+0x63): undefined reference to `cnt(int)'
collect2: error: ld returned 1 exit status
What does it mean? Here is the code:
#include
using namespace…

kaala
- 47
- 2
- 5