This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

13 wiersze
322B

  1. # if you run a script with -e that produces state that you want to clean up if
  2. # anything goes wrong in your script, this helps:
  3. #
  4. # Copyright (c) 2022 Jan Lehnardt <jan@apache.org>, MIT licensed
  5. trap 'handle_error' ERR
  6. handle_error () {
  7. echo "an error has occured, let’s clean up some stuff"
  8. # rm some-stuff.txt
  9. }