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