Quote:
echo "Enter month: "
read MONTH
awk '$3=="$MONTH" {print $1, $2, $3, $4, $5, $6}' *.hits
|
The data we are searching is populated in this way:
----IP---------DAY----MONTH----DATE--------TIME---------YEAR
12.3234.34-----Fri------Nov-------15-------18:05:14 GMT---2008
I want the user to be able to search for the data according to month and year.
However, I cannot quite figure out how to do this. Above is the code i have and i can't understand what is wrong?
If we try and put in the variable e.g Nov, it wont give us any results.
It works only if instead of "$MONTH" we enter the month itself e.g Nov or Sep.