Try this statement:
exit 1
Replace 1
with appropriate error codes. See also Exit Codes With Special Meanings.
Related Posts:
- How do I split a string on a delimiter in Bash?
- How do I tell if a regular file does not exist in Bash?
- How can I sandbox Python in pure Python?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- How do I parse command line arguments in Bash?
- How can I declare and use Boolean variables in a shell script?
- How can I declare and use Boolean variables in a shell script?
- “[ ]” vs. “[[ ]]” in Bash shell
- How do I split a string on a delimiter in Bash?
- How does “cat << EOF" work in bash?
- Bash scripting missing ‘]’
- How do I compare two string variables in an ‘if’ statement in Bash?
- Meaning of $? (dollar question mark) in shell scripts
- Difference between return and exit in Bash functions
- Bash script: bad interpreter
- How to count lines in a document?
- What does `set -x` do?
- Python script header
- Difference between a script and a program?
- Shell script not running, command not found
- Error handling in Bash
- How do I know the script file name in a Bash script?
- How to determine if a bash variable is empty?
- What is the difference between double and single square brackets in bash?
- What is “-bash: !”: event not found”
- How to make bash scripts print out every command before it executes?
- How can I fully log all bash scripts actions?
- What does passing the -xe parameters to /bin/bash do
- How can I run arbitrarily complex command using sudo over ssh?
- Why use Chef/Puppet over shell scripts?
- How do I deal with a filename that starts with the hyphen (-) character?
- Bash: No such file or directory?
- How to split a string into an array in Bash?
- How to create a file in Linux from terminal window? [closed]
- How to compare strings in Bash
- What does export PS1=”\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ ” mean in MacOS’ bash Terminal?
- How do I use a regex in a shell script?
- An example of how to use getopts in bash
- How do I execute a bash script in Terminal?
- How to run a PowerShell script
- Installing Homebrew on OS X
- Multi-line string with extra space (preserved indentation)
- Loop through an array of strings in Bash?
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- Pass a password to ssh in pure bash
- How do I iterate over a range of numbers defined by variables in Bash?
- Echo newline in Bash prints literal \n
- How to mkdir only if a directory does not already exist?
- What is the meaning of 2 in 2> /dev/null
- How to reload .bash_profile from the command line?
- Parsing JSON with Unix tools
- How to check if a variable is set in Bash?
- mvn command not found in OSX Mavrerick
- Cannot use mkdir in home directory: permission denied (Linux Lubuntu)
- Using find command in bash script
- What are the differences in die() and exit() in PHP?
- How to remove double-quotes in jq output for parsing json files in bash?
- How to use sys.exit() in Python
- Git Bash won’t run my python files?
- How to terminate the script in JavaScript?
- Given two directory trees, how can I find out which files differ by content?
- How to change the output color of echo in Linux
- Recursively find all files that match a certain pattern
- Delete all local git branches
- bash assign default value
- What does -z mean in Bash?
- echo that outputs to stderr
- How do I set a variable to the output of a command in Bash?
- What is the $? (dollar question mark) variable in shell scripting?
- Trying to use bash on Windows and got no installed distributions message
- Simple logical operators in Bash
- Bash if statement with multiple conditions throws an error
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Laravel PHP Command Not Found
- bash : Bad Substitution
- Getting an “ambiguous redirect” error
- Bash syntax error: unexpected end of file
- -bash: fork: Cannot allocate memory
- Is there a “goto” statement in bash?
- -bash: export: `=’: not a valid identifier
- How do I automatically restart a Minecraft Spigot server in the event of a crash or /stop when using screen?
- How can I add numbers in a Bash script?
- RE error: illegal byte sequence on Mac OS X
- bash: mkvirtualenv: command not found
- Using SED with wildcard
- Stopping a JavaScript function when a certain condition is met
- How to split one string into multiple strings separated by at least one space in bash shell?
- “Error installing rails” because “extconf.rb failed” on Ubuntu 18.04
- How to ssh from within a bash script?
- Closing Application with Exit button
- bash : cd : too many arguments
- Bash mkdir and subfolders
- Print array elements on separate lines in Bash?
- How to include file in a bash shell script
- Integer expression expected error in shell script
- bash sh – command not found
- Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”
- Check if array is empty in Bash
- Clean way to write complex multi-line string to a variable
- How to remove invalid characters from filenames?