summaryrefslogtreecommitdiff
path: root/regress/usr.bin/tail/forward-blocks.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/usr.bin/tail/forward-blocks.sh')
-rw-r--r--regress/usr.bin/tail/forward-blocks.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/regress/usr.bin/tail/forward-blocks.sh b/regress/usr.bin/tail/forward-blocks.sh
new file mode 100644
index 00000000000..727f95461c7
--- /dev/null
+++ b/regress/usr.bin/tail/forward-blocks.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $OpenBSD: forward-blocks.sh,v 1.1 2015/11/24 04:04:19 tedu Exp $
+
+# test if tail grep the correct number of blocks from a file.
+
+DIR=$(mktemp -d)
+echo DIR=${DIR}
+
+NAME=${0##*/}
+OUT=${DIR}/${NAME%%.sh}.out
+i=0
+while [ ${i} -lt 512 ]; do
+ echo ${i} >> ${DIR}/bar
+ i=$((i+1))
+done
+
+tail -b +1 ${DIR}/bar > ${OUT}
+
+diff -u ${OUT} ${0%%.sh}.out || exit 1
+
+# cleanup if okay
+rm -Rf ${DIR}