Skip to content

Instantly share code, notes, and snippets.

@louisthomas
Created March 20, 2019 18:28
Show Gist options
  • Save louisthomas/fe6b922e88320bc570961303e784b5f7 to your computer and use it in GitHub Desktop.
Save louisthomas/fe6b922e88320bc570961303e784b5f7 to your computer and use it in GitHub Desktop.
You could set a "trap" to execute on exit or on a control-c to clean up. create a directory in which to place all my temporary files, and then immediately after, create an EXIT handler to clean up this directory when the script exits. https://stack
tempfile="$(mktemp)"
trap "rm -rf \"${tempfile}\"" EXIT
jq "..."> $tempfile && mv $tempfile ${CLUSTER_DEFINITION}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment