This is a handy function for when you have a script that you need to run interactively you can call it with the || or operator, if any steps fail it will print out the line number and exit

#!/bin/bash
fail_notify() {
 echo "step "$@" on line $BASH_LINENO failed <><><><><><><><><><><><><><><"
 exit
}

mount -o rw,remount / || fail_notify "remount of root"