2
Misuse
Misuse of shell builtins
Standard
Exit Code Information
Exit Code
2
Name
Misuse
Category
Standard
Usage Context
Missing keyword or command, or permission problem
Common Usage
Bash Script
#!/bin/bash if [ condition ]; then echo "Misuse" exit 2 fi
Check Exit Code
./script.sh echo $? # Prints the exit code # Check if exit code matches if [ $? -eq 2 ]; then echo "Misuse" fi
Node.js/JavaScript
// Exit with code 2
process.exit(2);
// Or throw error that results in exit code
if (error) {
console.error('Misuse');
process.exit(2);
}Python
import sys
# Exit with code 2
if error:
print("Misuse")
sys.exit(2)Exit Code 2 - Misuse
Misuse of shell builtins Missing keyword or command, or permission problem 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.