trap_error() {
  printf '%b\n' "\nERROR line ${1}: Command exited with status ${?}"
}
trap 'trap_error ${LINENO}' INT # trap ERR
trap - INT # reset the ERR trap
