]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/source6.sub
Bash-4.3 patch 7
[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 echo "echo three - OK" | . /dev/stdin
23 echo $?
24
25 # FIFO
26 mkfifo $TMPDIR/fifo-$$
27 echo "echo four - OK" > $TMPDIR/fifo-$$ &
28 sleep 1 # allow the child echo to execute
29 . $TMPDIR/fifo-$$
30 echo $?
31 rm -f $TMPDIR/fifo-$$