#!/bin/bash # for sending error messages from functions and whatnot ERROR_CODE="$?" >&2 echo "$0: An error occurred on line number ${1}" return $ERROR_CODE