]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/source6.sub
Bash-5.0 patch 11: fix quoted null character removal in operands of conditional ...
[thirdparty/bash.git] / tests / source6.sub
1 # tests sourcing non-regular files, fixed post-3.2
2
3 : ${TMPDIR:=/tmp}
4
5 TMPFN=$TMPDIR/foo-$$
6
7 rm -f $TMPFN
8 echo "echo one - OK" > $TMPFN
9 . $TMPFN
10 echo $?
11 rm -f $TMPFN
12
13 # non-regular readable file
14 . /dev/null
15 echo $?
16
17 # FIFO or pipe via /dev/fd
18 . <(echo "echo two - OK")
19 echo $?
20
21 # pipe
22 if [ -e /dev/stdin ]; then
23 echo "echo three - OK" | . /dev/stdin
24 echo $?
25 else
26 # no /dev/stdin, just fake it
27 echo "three - OK" ; echo 0
28 fi
29
30 # FIFO
31 mkfifo $TMPDIR/fifo-$$
32 echo "echo four - OK" > $TMPDIR/fifo-$$ &
33 sleep 1 # allow the child echo to execute
34 . $TMPDIR/fifo-$$
35 echo $?
36 rm -f $TMPDIR/fifo-$$