Exemple de TRAP sur LINUX

OP
S2

sh2lac

il y a 8 mois

voici un exemple d'utilisation de la fonction trap sur linux https://image.noelshack.com/fichiers/2021/23/3/1623203478-efhdfh.gif

tmp="$(mktemp)" preexit() { [[ tmp != "" ]] && rm -rf "$tmp" exit } trap preexit SIGTERM SIGINT sleep infinity

ici la fonction supprime un dossier temporaire lorsque l'on ferme gracieusement le script https://image.noelshack.com/fichiers/2021/23/3/1623203478-efhdfh.gif

OP
S2

sh2lac

il y a 8 mois

toute ressemblance entre le nom de la commande et les femboys mignons est fortuite https://image.noelshack.com/fichiers/2021/23/3/1623203478-efhdfh.gif

ME

Meschos

il y a 8 mois

Merci!

OP
S2

sh2lac

il y a 8 mois


Merci!

derien j'espère t'avoir éclairé https://image.noelshack.com/fichiers/2021/23/3/1623203478-efhdfh.gif

OP
S2

sh2lac

il y a 8 mois

posez vos questions si vous en avez https://image.noelshack.com/fichiers/2021/23/3/1623203478-efhdfh.gif