#!/bin/sh
# Counts the number of times first parameter (string) occurs in a
# file.
# Sara Sprenkle

# make sure we have the right number of arguments passed in
ARGS=2       # Number of arguments expected.
E_BADARGS=65  # Exit value if incorrect number of args passed.

test $# -lt $ARGS && echo "Usage: `basename $0` <whichstring> <whichfile>" && exit $E_BADARGS



# Parameter 1: string
# Parameter 2: file
grep $1 $2 | wc -l


echo The number of parameters is $#
echo All the arguments:  $*
echo All the arguments: "$@"

