This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

10 рядки
253B

  1. # if you run a script with -e that produces state that you want to clean up if anything goes wrong in your script, this helps:
  2. trap 'handle_error' ERR
  3. handle_error () {
  4. echo "an error has occured, let’s clean up some stuff"
  5. # rm some-stuff.txt
  6. }