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