blob: 1c3d7e0953b2c8fcbdaa7a689d975470023073b1 [file] [log] [blame]
Dan Gohmand0fb8d62007-08-10 15:07:05 +00001#!/bin/sh
2#
3# Program: count
4#
5# Synopsis: Count the number of lines of input on stdin and test that it
6# matches the specified number.
7#
8# Syntax: count <number>
9
10set -e
11set -u
Chris Lattner33fc8212008-06-25 16:03:42 +000012input_lines=`wc -l`
Dan Gohmand0fb8d62007-08-10 15:07:05 +000013if [ "$input_lines" -ne "$1" ]; then
14 echo "count: expected $1 lines and got ${input_lines}."
15 exit 1
16fi
17exit 0