Add/fix copyright notices and adjust to latest GNU FDL.
[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 # Copyright (C) 1999, 2002 Free Software Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21 if test "$VERBOSE" = yes; then
22   set -x
23   tail --version
24 fi
25
26 tmp=tail-inf1.$$
27 pwd=`pwd`
28 trap "cd $pwd; rm -rf $tmp" 0 1 2 3 15
29
30 test_failure=0
31 mkdir $tmp || test_failure=1
32 cd $tmp || test_failure=1
33
34 if test $test_failure = 1; then
35   echo 'failure in testing framework'
36   exit 1
37 fi
38
39 yes > t &
40 yes_pid=$!
41 while :; do
42   test -s t && break
43 done
44 tail -n 1 t &
45 tail_pid=$!
46 kill $yes_pid
47 sleep 1
48 kill $tail_pid