Код очистки Bash
#!/bin/bash
function finish {
# Your cleanup code here
}
trap finish EXIT
Horrible Hamster
#!/bin/bash
function finish {
# Your cleanup code here
}
trap finish EXIT