Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 250 Bytes

catch-signal.md

File metadata and controls

15 lines (10 loc) · 250 Bytes

Catch a signal (2016-02-12)

You can catch signals in bash using trap:

#!/bin/bash 

_handler() { 
  echo "Wow!"
}

trap _handler SIGTERM

It can be useful for manipulating children processes or Docker containers started by a script.