Hi all. I'm trying to grep for a range of files.
The file names are wavelog.20031005 through wavelog.20031008.
My script looks like thisrm /dso/mis/scripts/labelcounts/1log.txt
print "Would you like to get counts for only 1 day? (y/n) \c"
read ans
if [ $ans = "y" -o $ans = "Y" ]
then
print "Please enter the date you wish to search... (yyyymmdd) \c"
read Date
print "Please enter the printer you wish to search for... \c"
read prt
if [ /dso/eis/log/labelcounts.* = /dso/eis/log/labelcounts.$Date ]
then
grep $prt /dso/eis/log/labelcounts.$Date >> /dso/mis/scripts/labelcounts/1log.txt
grep $prt /dso/eis/log/wavelog.$Date >> /dso/mis/scripts/labelcounts/1log.txt
else
grep $prt /dso/eis/log/wavelog.$Date >> /dso/mis/scripts/labelcounts/1log.txt
fi
fi
if [ $ans = "n" -o $ans = "N" ]
then
print "Would you like to search for a range of dates ... (y/n) \c"
read ans1
if [ $ans1 = "y" -o $ans1 = "Y" ]
then
print "Please enter the first date ... (yyyymmdd) \c"
read Date1
print "Please enter the second date ... (yyyymmdd) \c"
read Date2
else
exit
fi
fi
So my first date is Date1 and my second date is Date2. How can I tie in grep to search files between the two dates I enter?
Thanks for the help.
jalge2
The file names are wavelog.20031005 through wavelog.20031008.
My script looks like thisrm /dso/mis/scripts/labelcounts/1log.txt
print "Would you like to get counts for only 1 day? (y/n) \c"
read ans
if [ $ans = "y" -o $ans = "Y" ]
then
print "Please enter the date you wish to search... (yyyymmdd) \c"
read Date
print "Please enter the printer you wish to search for... \c"
read prt
if [ /dso/eis/log/labelcounts.* = /dso/eis/log/labelcounts.$Date ]
then
grep $prt /dso/eis/log/labelcounts.$Date >> /dso/mis/scripts/labelcounts/1log.txt
grep $prt /dso/eis/log/wavelog.$Date >> /dso/mis/scripts/labelcounts/1log.txt
else
grep $prt /dso/eis/log/wavelog.$Date >> /dso/mis/scripts/labelcounts/1log.txt
fi
fi
if [ $ans = "n" -o $ans = "N" ]
then
print "Would you like to search for a range of dates ... (y/n) \c"
read ans1
if [ $ans1 = "y" -o $ans1 = "Y" ]
then
print "Please enter the first date ... (yyyymmdd) \c"
read Date1
print "Please enter the second date ... (yyyymmdd) \c"
read Date2
else
exit
fi
fi
So my first date is Date1 and my second date is Date2. How can I tie in grep to search files between the two dates I enter?
Thanks for the help.
jalge2