exitstatus

How to return a number larger than 8 bits from main()?

自闭症网瘾萝莉.ら 提交于 2021-02-05 07:55:29
问题 So as far as I can tell, the exit code returned from r0 only uses the lowest 8 bits of this register. How wouuld I return a value higher than 8 bits? Here is the ARMv7 code: @ looping.s @ calculates sum of integers from 1 to 100 .text .balign 4 .global main main: MOV r1, #0 @ r1 = 0 as sum MOV r2, #0 @ r2 = 0 as counter loop: ADD r2, r2, #1 @ counter = counter + 1 ADD r1, r1, r2 @ sum = sum + counter CMP r2, #100 @ counter - 100 BLT loop @ if counter < 100 go to start of loop MOV r0, r1 @

Why does my script suddenly exit after a command?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 07:12:08
问题 I am trying to generate docsets for Dash following these instructions: http://kapeli.com/docsets. The problem is, that the script doesn't continue after the wget and doesn't appear to throw any errors. Everything works fine when I copy the script into the Terminal. I'm using MacOS 10.8.4 and the default bash. #!/usr/bin/env bash set -e mkdir -p $1.docset/Contents/Resources/Documents/ echo "THIS RUNS" wget -rkp -l3 -np -nH --cut-dirs=1 --directory-prefix="./"$1".docset/Contents/Resources

Why does my script suddenly exit after a command?

泄露秘密 提交于 2021-02-05 07:11:06
问题 I am trying to generate docsets for Dash following these instructions: http://kapeli.com/docsets. The problem is, that the script doesn't continue after the wget and doesn't appear to throw any errors. Everything works fine when I copy the script into the Terminal. I'm using MacOS 10.8.4 and the default bash. #!/usr/bin/env bash set -e mkdir -p $1.docset/Contents/Resources/Documents/ echo "THIS RUNS" wget -rkp -l3 -np -nH --cut-dirs=1 --directory-prefix="./"$1".docset/Contents/Resources

ffmpeg exit status -1094995529

故事扮演 提交于 2020-12-30 07:38:27
问题 I'm developing an application that makes calls to ffprobe that return the unorthodox exit status of -1094995529 for certain files when on Windows. This exit status is given consistently, and there is some minor discussion of this. Why is this value given, and where is it documented? Can I expect this status to be different on a unix machine where the allowed exit statuses are more constrained? 回答1: Error codes from ffmpeg (error.h from avutil) : http://ffmpeg.org/doxygen/trunk/error_8h_source

Bash exit status of shorthand increment notation

守給你的承諾、 提交于 2020-12-25 08:42:52
问题 I noticed an apparent inconsistency in the return status of bash's (( )) notation. Consider the following $> A=0 $> ((A=A+1)) $> echo $? $A 0 1 However using the other well known shorthand increment notation yields: $> A=0 $> ((A++)) $> echo $? $A 1 1 If one has the builtin set -e in the script the second notation will cause the script to exit, since the exit status of the ((A++)) returned non-zero. This question was more or less addressed in this related question. But it does not seem to

Bash exit status of shorthand increment notation

天大地大妈咪最大 提交于 2020-12-25 08:42:08
问题 I noticed an apparent inconsistency in the return status of bash's (( )) notation. Consider the following $> A=0 $> ((A=A+1)) $> echo $? $A 0 1 However using the other well known shorthand increment notation yields: $> A=0 $> ((A++)) $> echo $? $A 1 1 If one has the builtin set -e in the script the second notation will cause the script to exit, since the exit status of the ((A++)) returned non-zero. This question was more or less addressed in this related question. But it does not seem to

How to tell if any command in bash script failed (non-zero exit status)

回眸只為那壹抹淺笑 提交于 2019-12-18 14:49:33
问题 I want to know whether any commands in a bash script exited with a non-zero status. I want something similar to set -e functionality, except that I don't want it to exit when a command exits with a non-zero status. I want it to run the whole script, and then I want to know that either: a) all commands exited with exit status 0 -or- b) one or more commands exited with a non-zero status e.g., given the following: #!/bin/bash command1 # exits with status 1 command2 # exits with status 0 command3

cython failed with exit status 2 when trying to access library

旧城冷巷雨未停 提交于 2019-12-11 16:19:00
问题 cdef extern from "cblas.h": enum CBLAS_ORDER: CblasRowMajor=101 CblasColMajor=102 enum CBLAS_TRANSPOSE: CblasNoTrans=111 CblasTrans=112 CblasConjTrans=113 AtlasConj=114 This code returns the error CompileError: Command "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\ProgramData\Anaconda2\lib\site-packages\numpy\core\include -IC:\ProgramData\Anaconda2\lib\site-packages\numpy\core\include -IC:\ProgramData\Anaconda2\include -IC:

How to check the first character in a string in Bash or UNIX shell?

跟風遠走 提交于 2019-12-03 03:51:20
问题 I'm writing a script in UNIX where I have to check whether the first character in a string is "/" and if it is, branch. For example I have a string: /some/directory/file I want this to return 1, and: server@10.200.200.20:/some/directory/file to return 0. 回答1: Many ways to do this. You could use wildcards in double brackets: str="/some/directory/file" if [[ $str == /* ]]; then echo 1; else echo 0; fi You can use substring expansion: if [[ ${str:0:1} == "/" ]] ; then echo 1; else echo 0; fi Or

unix shell, getting exit code with piped child

六月ゝ 毕业季﹏ 提交于 2019-12-01 17:00:59
问题 Let's say I do this in a unix shell $ some-script.sh | grep mytext $ echo $? this will give me the exit code of grep but how can I get the exit code of some-script.sh EDIT Assume that the pipe operation is immutable. ie, I can not break it apart and run the two commands seperately 回答1: There are multiple solutions, it depends on what you want to do exactly. The easiest and understandable way would be to send the output to a file, then grep for it after saving the exit code: tmpfile=$(mktemp)