Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

exitstatus

Meaning of exit status 1 returned by linux command

August 15, 2023 by Tarik

The only general convention is that a zero exit status signifies success, whereas any non-zero exit status is a failure. Many — but certainly not all — command-line tools return exit code 1 for syntax error, i.e. you had too few arguments or an invalid option. Many — but, alas, not all — command-line tools … Read more

Categories linux Tags command, exitstatus, linux Leave a comment

What is the authoritative list of Docker Run exit codes?

February 2, 2023 by Tarik

For Docker >= 1.10 see this PR, which follows standard chroot exit codes: 125: docker run itself fails 126: contained command cannot be invoked 127: if contained command cannot be found 128 + n Fatal error signal n: 130 = (128+2) Container terminated by Control-C 137 = (128+9) Container received a SIGKILL 143 = (128+15) … Read more

Categories docker Tags docker, exitstatus Leave a comment

How can I check the first character in a string in Bash or Unix shell?

January 8, 2023 by Tarik

There are 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 a regex: if [[ $str =~ ^/ … Read more

Categories string Tags bash, character, exitstatus, string, unix Leave a comment

How to exit if a command failed? [duplicate]

October 1, 2022 by Tarik

Try: my_command || { echo ‘my_command failed’ ; exit 1; } Four changes: Change && to || Use { } in place of ( ) Introduce ; after exit and spaces after { and before } Since you want to print the message and exit only when the command fails ( exits with non-zero value) … Read more

Categories linux Tags bash, exit, exitstatus, linux Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa