This is a slowly growing collection of hopefully useful and reusable shell functions and patterns. https://code.jan.io/jan/jans_shell_utils
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 3 años
hace 3 años
hace 3 años
1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # Copyright (c) 2022 Jan Lehnardt <jan@apache.org>, MIT licensed
  3. . ../lib.sh
  4. echo "testing assert_arg"
  5. global_error=0
  6. expect=1
  7. result=`assert_arg`
  8. if [ $? -ne $expect ]; then
  9. echo "assert_arg with no parameter fails"
  10. global_error=1
  11. fi
  12. echo .
  13. expect=0
  14. result=`assert_arg foo`
  15. if [ $? -ne $expect ]; then
  16. echo "assert_arg with parameter does not pass"
  17. global_error=1
  18. echo .
  19. fi
  20. echo .
  21. if [ $global_error -ne 0 ]; then
  22. echo "one or more tests failed"
  23. exit 1
  24. else
  25. echo "all tests pass"
  26. exit 0
  27. fi