Hello,
I am writing a small script which I want to get the values from several files and output the hits result, i.e. week1.hits includes the following,
Mon Feb 4 22:02:35 GMT 2008
Tue Feb 5 23:22:12 GMT 2008
Sat Feb 9 01:56:16 GMT 2008
A sample of my script is this,
#!/bin/bash
echo Please enter either a day a month or a year
read DAT
week1=`grep $DAT week1.hits | wc -l`
week2=`grep $DAT week2.hits | wc -l`
week2=`grep $DAT week3.hits | wc -l`
echo =============================
echo -e "PAGE\t\t HITS\t "
echo =============================
echo -e "Week1\t $week1"
echo -e "Week2\t $week2"
echo -e "Week3\t\t $week3"
Now when I put Feb 2008 the script will output the appropriate number filtering form the 3 files week1, week2, week3 that include Feb 2008.
What I want to do is try to filter days as well. For example, if the user types Mon - Wed, script will output the appropriate result in number as for Feb 2008.
If anyone could be any help would be much appreciated.
Many thanks!