If run over ssh, a script with a trap statement with interrupt signal names (SIGINT, etc) gives an error and the trap does not work when an interrupt (eg. Ctrl+C) is sent. Eg:
#!/bin/bash
trap 'echo "Exit signal detected..."' SIGINT
# display something
echo "This is a test"
sleep 100000
When this is run over ssh, it prints an error
trap: SIGINT: bad trap
and trap's command is never executed.
The problem is over ssh only; if run locally it works.
However, if the interrupt signal number (2) is used instead the name (SIGINT), it works including over ssh.
I thought it's preferable to use signal names and not signal numbers.
EDIT: Local system is running Fedora 28, and remote system is on Ubuntu 18.04.