Skip to content

Instantly share code, notes, and snippets.

@goneri
Created October 28, 2022 17:22
Show Gist options
  • Save goneri/9b801be15da37e7cee44295608bf1000 to your computer and use it in GitHub Desktop.
Save goneri/9b801be15da37e7cee44295608bf1000 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -eux
function cleanup()
{
echo "Something went wrong! Let's clean up."
}
trap cleanup EXIT
ls /
ls /
ls /nothing
echo "We should never reach this point"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment