jueves, 12 de diciembre de 2024

Bash script do a cleanup on exit

Excellent way to do a cleanup on exit.

#!/bin/bash

set -e # Exit on error

# Functions for cleanup on exit
cleanup() {
echo "Removing what is done..."
}
trap cleanup EXIT

No hay comentarios:

Publicar un comentario