#!/bin/bash

#----Ask the user for the file extension if none provided
if [ "$#" -lt 1 ]; then
    read -p "What file type: " FileType
else
    FileType=$1
fi

echo "Looking through $FileType files"

#----Look in each file of that type
for File in *.$FileType; do
    echo -n "Searching $File ... "
    #----Count the number of lines containing "int"
    IntCount=$(grep -c "int" "$File")
    echo "It has $IntCount lines containing int"
done
