0
Success
Successful execution
Standard
Exit Code Information
Exit Code
0
Name
Success
Category
Standard
Usage Context
Command completed successfully without errors
Common Usage
Bash Script
#!/bin/bash if [ condition ]; then echo "Success" exit 0 fi
Check Exit Code
./script.sh echo $? # Prints the exit code # Check if exit code matches if [ $? -eq 0 ]; then echo "Success" fi
Node.js/JavaScript
// Exit with code 0
process.exit(0);
// Or throw error that results in exit code
if (error) {
console.error('Success');
process.exit(0);
}Python
import sys
# Exit with code 0
if error:
print("Success")
sys.exit(0)Exit Code 0 - Success
Successful execution Command completed successfully without errors Exit codes are used to indicate the success or failure of a program or script. A value of 0 typically indicates success, while non-zero values indicate various types of errors or specific conditions.