a540a645b8862e60f60c5239dc1038c398921621
[platform/upstream/coreutils.git] / tests / tail-2 / infloop-1
1 #!/bin/sh
2 # This test would fail with tail from pre-1.22i textutils.
3
4 if test "$VERBOSE" = yes; then
5   set -x
6   tail --version
7 fi
8
9 tmp=tail-inf1.$$
10 pwd=`pwd`
11 trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
12
13 test_failure=0
14 mkdir $tmp || test_failure=1
15 cd $tmp || test_failure=1
16
17 if test $test_failure = 1; then
18   echo 'failure in testing framework'
19   exit 1
20 fi
21
22 yes > t &
23 yes_pid=$!
24 while :; do
25   test -s t && break
26 done
27 tail -n 1 t &
28 tail_pid=$!
29 kill $yes_pid
30 sleep 1
31 kill $tail_pid