This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

27 řádky
249B

  1. debug () {
  2. if [ -n "$DEBUG" ]; then
  3. echo "$1"
  4. fi
  5. }
  6. debug_inline () {
  7. if [ -n "$DEBUG" ]; then
  8. printf "$1"
  9. fi
  10. }
  11. error_and_exit () {
  12. echo $1 || "error"
  13. exit 1
  14. }
  15. assert_arg () {
  16. arg=$1
  17. if [ -z "$arg" ]; then
  18. return 1
  19. fi
  20. return 0
  21. }