This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
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. }