mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
18 lines
325 B
Plaintext
18 lines
325 B
Plaintext
|
#!/bin/sh
|
||
|
#
|
||
|
# Program: count
|
||
|
#
|
||
|
# Synopsis: Count the number of lines of input on stdin and test that it
|
||
|
# matches the specified number.
|
||
|
#
|
||
|
# Syntax: count <number>
|
||
|
|
||
|
set -e
|
||
|
set -u
|
||
|
input_lines=$(wc -l)
|
||
|
if [ "$input_lines" -ne "$1" ]; then
|
||
|
echo "count: expected $1 lines and got ${input_lines}."
|
||
|
exit 1
|
||
|
fi
|
||
|
exit 0
|