cc45f8694eff15b31191d8cd5799c41acf292b37
[platform/upstream/coreutils.git] / tests / tee / dash
1 #!/bin/sh
2 # test for "tee -".
3
4 if test "$VERBOSE" = yes; then
5   set -x
6   tee --version
7 fi
8
9 pwd=`pwd`
10 t0=`echo "$0" |sed 's,.*/,,'`.tmp; tmp=$t0/$$
11 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
12 trap 'status=$?; (exit $status); exit $status' 1 2 13 15
13
14 fail=0
15 mkdir -p $tmp && cd $tmp || fail=1
16
17 if test $fail = 1; then
18   echo "$0: failure in testing framework" 1>&2
19   (exit 1); exit 1
20 fi
21
22 tee - </dev/null || fail=1
23
24 (exit $fail); exit $fail