#! /bin/bash
#
# You MUST be able to run this script file as:
#    bash findtest
# Do NOT make any changes that makes it fail to execute.
# Change only PUTYOURGREPEXPRESSIONHERE at the end of the three find commands
# (And for Perlsters, you may also change the options for grep)
# Print *only* matching lines!

MATCHFILE=testlines.txt
if [ "$#" -ne 0 ]; then
    MATCHFILE="$1"
fi
echo "Regular line matcher for the file $MATCHFILE"
echo
echo "GREP1:"
echo "   Match lines that start a colon ':'"
grep -E PUTYOURGREPEXPRESSIONHERE "$MATCHFILE"
echo
echo "GREP2:"
echo "   Match lines that contain A+++ (A followed by three plus signs)"
grep -E PUTYOURGREPEXPRESSIONHERE "$MATCHFILE"
echo
echo "GREP3:"
echo "   Match lines that contain the words 'sys' and 'admin'"
echo "   separated by white space, that is, one of more spaces or tabs"
grep -E PUTYOURGREPEXPRESSIONHERE "$MATCHFILE"
echo
echo "GREP4:"
echo "   Match lines that contain at least three digits"
grep -E PUTYOURGREPEXPRESSIONHERE "$MATCHFILE"
