keecode logokeecode
137

Killed (SIGKILL)

Process killed (signal 9)

Signal

Exit Code Information

Exit Code

137

Name

Killed (SIGKILL)

Category

Signal

Usage Context

Process was forcefully killed

Common Usage

Bash Script

#!/bin/bash

if [ condition ]; then
  echo "Killed (SIGKILL)"
  exit 137
fi

Check Exit Code

./script.sh
echo $?  # Prints the exit code

# Check if exit code matches
if [ $? -eq 137 ]; then
  echo "Killed (SIGKILL)"
fi

Node.js/JavaScript

// Exit with code 137
process.exit(137);

// Or throw error that results in exit code
if (error) {
  console.error('Killed (SIGKILL)');
  process.exit(137);
}

Python

import sys

# Exit with code 137
if error:
    print("Killed (SIGKILL)")
    sys.exit(137)