$?
— Gets the exit status of the last command (0 = success, non-zero = failure)||
— Run a command *if previous command fails*&&
— Run a command *if previous command succeeds*trap
— Catch signals (like CTRL+C
or errors) and run cleanup codeexit
— Exit script with a status code