Example bash code for error trapping