mkfifo.test 600 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. [ -f testing.sh ] && . testing.sh
  3. #testing "name" "command" "result" "infile" "stdin"
  4. testing "mkfifo" "mkfifo one && [ -p one ] && echo yes" "yes\n" "" ""
  5. rm one
  6. touch existing
  7. testing "existing" \
  8. "mkfifo existing 2> /dev/null || [ -f existing ] && echo yes" "yes\n" "" ""
  9. rm existing
  10. testing "one two" \
  11. "mkfifo one two && [ -p one ] && [ -p two ] && echo yes" "yes\n" "" ""
  12. rm one two
  13. umask 123
  14. testing "(default permissions)" \
  15. "mkfifo one && stat -c %a one" "644\n" "" ""
  16. rm one
  17. umask 000
  18. testing "-m 124" \
  19. "mkfifo -m 124 one && stat -c %a one" "124\n" "" ""
  20. rm -f one