I have a simple script :
#!/bin/bash set -e trap \"echo BOO!\" ERR function func(){ ls /root/ } func
I would like to trap ERR if my
You need to use set -o errtrace for the function to inherit the trap.
set -o errtrace