exit-code

MSBuild exec task, exit code empty

核能气质少年 提交于 2019-12-04 03:20:32
问题 I have the following exec task, performing checkin of assemblyinfo.cs files. I'm trying to return the exit code, but for some reason it is always empty. <!--Checkin if all succeeded--> <Exec Condition=" '$(LocalCompilationSuccess)' != 'Failed' and '$(LocalTestSuccess)' != 'Failed' " ContinueOnError="True" Command='"$(TfCommand)" checkin /recursive /comment:"$(NoCICheckInComment) $(BuildDefinitionName): build succeeded, checkin changes." /override:"TeamBuild $(BuildDefinitionName)" $

Retrieve exit status from php script inside of shell script

蹲街弑〆低调 提交于 2019-12-04 03:19:41
I have a bash shell script that calls a few PHP scripts like this. #!/bin/bash php -f somescript.php php -f anotherscript.php I want to compose an error log and/or an activity report based on the results of those scripts. Is there any way I can get the exit status of the php script in the shell script? I could either use integer exit statuses or string messages. You can easily catch the output using the backtick operator, and get the exit code of the last command by using $? : #!/bin/bash output=`php -f somescript.php` exitcode=$? anotheroutput=`php -f anotherscript.php` anotherexitcode=$?

Powershell fails to return proper exit code

故事扮演 提交于 2019-12-04 02:26:22
When executing a Powershell script (in 2.0) using the -File command line switch, and explicitly defining the input parameters in Param, the exit code is always "0" (never fails) instead of properly returning the defined or expected error code. This does not occur when using the explicit parameter definitions and the -Command switch, however for extraneous purposes, I need to keep the -File switch in my scripts. Any assistance with a workaround (that doesn't involve removing the explicit parameter definitions) would be extremely helpful. Powershell "fails to return correct exit code": exit1.ps1

why does my JScript (windows script host) exit with 0 on an uncaught exception?

≡放荡痞女 提交于 2019-12-03 19:28:40
I have some JScript which does some stuff with an ODBC connection. An exception was thrown by the ODBC ActiveXObject object and not caught in my script. I expected that the script would exit with an non 0 value but it didn't. Anyone know why this is the case and how to get it to exit with a non 0 value on an uncaught exception? AnthonyWJones The JScript engine can be thought of as a virtual machine. If the JScript engine itself or the script host were to have some form of catastrophic failure you could expect to get a non zero exit code (for example an the script host couldn't find one of the

Add (collect) exit codes in bash

自闭症网瘾萝莉.ら 提交于 2019-12-03 17:47:36
问题 I need to depend on few separate executions in a script and don't want to bundle them all in an ugly 'if' statement. I would like to take the exit code '$?' of each execution and add it; at the end, if this value is over a threshold - I would like to execute a command. Pseudo code: ALLOWEDERROR=5 run_something RESULT=$? ..other things.. run_something_else RESULT=$RESULT + $? if [ $RESULT -gt ALLOWEDERROR ] then echo "Too many errors" fi Issue: Even though the Internet claims otherwise, bash

java was started but returned exit code

本秂侑毒 提交于 2019-12-03 14:55:51
when i was starting eclipse, i first got this error dialog: After this error,i researched and found a solution here . this solution asked me to give this line in eclipse.ini: -vm C:\Program Files (x86)\Java\jdk1.7.0_25\bin\javaw.exe but after adding this, i found another kind of error dialog: after this error,i researched alot, and found these solutions sol1 , sol2 after following these, error is not resolved. does anyone know why i am facing this problem. note: i know this is kind of duplicate question, but all those duplicate question are not resolved yet, so do not mark this as duplicate!

How to capture the Gradle exit code in a shell script?

感情迁移 提交于 2019-12-03 13:41:15
I would like to capture the return code of a Gradle task. Here is a small bash script draft which executes a tasks: #!/bin/bash gradlew_return_code=`./gradlew assembleDebug` echo ">>> $gradlew_return_code" if [ "$gradlew_return_code" -eq "0" ]; then echo "Gradle task succeeded." else echo "Gradle task failed." fi The script does not store the return value but instead the whole console output of the Gradle task. Please note that the example script is a simplification of a more complex script where I need to capture the return value. Exit status is in $? . Command substitutions capture output .

npm run cmd fails while cmd on command line works

泄露秘密 提交于 2019-12-03 11:50:43
In my HTTP Status Check project : If I run node_modules/.bin/jshint . I get: $ node_modules/.bin/jshint . test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon. 1 error It executes correctly and produces the expected output: 1 error. But if I add that command to package.json and try and run it through npm run then it works and produces the expected output but also follows that with a bunch of errors: $ npm run jshint > http-status-check@0.0.5 jshint /home/guy/source/http-status-check > jshint . test/inAdapters_fileAdapter.js: line 73, col 31, Missing semicolon. 1 error npm ERR!

PL/SQL: is there an instruction to completely stop the script execution?

你。 提交于 2019-12-03 11:09:17
I'm trying to do some checkings on a DB schema at the beginning of a PL/SQL script. If the checkings give unsuccessful results, I want to stop the script, to prevent the next instructions to be executed. I got something like this -- 1st line of PL/SQL script DECLARE SOME_COUNT INTEGER; BEGIN SELECT COUNT(*) INTO SOME_COUNT FROM SOME_TABLE WHERE <SOME_CONDITIONS>; IF (SOME_COUNT > 0) THEN DBMS_OUTPUT.PUT_LINE('Test failed, I don''want the rest of the script' || ' to be executed.'); --EXIT or something like that?... <= STOP EXECUTION HERE END IF; END; / -- OTHER SQL INSTRUCTIONS... ALTER TABLE

Check if process returns 0 with batch file

霸气de小男生 提交于 2019-12-03 10:32:20
问题 I want to start a process with a batch file and if it returns nonzero, do something else. I need the correct syntax for that. Something like this: ::x.bat @set RetCode=My.exe @if %retcode% is nonzero handleError.exe As a bonus, you may consider answering the following questions, please :) How to write a compound statement with if ? If the application My.exe fails to start because some DLL is missing will my if work? If not, how can I detect that My.exe failed to start? 回答1: ERRORLEVEL will