Would this be OK?
Every line holding date > 10th and < 18th:
awk '$2 > 10 && $2 < 18 {print}' file
Including month name:
awk '$1 == "May" && $2 > 10 && $2 < 18 {print}' file
Span months, April 27th to May 4th:
awk '($1 == "Apr" && $2 > 26) || ($1 == "May" && $2 < 5){print}' file
Update:
A sketchy variant using getline:
awk '"date '+%m%d' -d " $1$2 | getline date; close("date"); \
date > 426 && date < 505 {print}' file
Using script:
awk -v from=520 -v to=523 '
{
d = ((match("JanFebMarAprMayJunJulAugSepOctNovDec", $1) + 2) / 3 )$2;
if (d >= from && d <= to)
print;
}
' file
Using switch:
awk -v from=520 -v to=523 '
function date2time()
{
switch ($1) {
case "Jan": return 1$2; break;
case "Feb": return 2$2; break;
case "Mar": return 3$2; break;
case "Apr": return 4$2; break;
case "May": return 5$2; break;
case "Jun": return 6$2; break;
case "Jul": return 7$2; break;
case "Aug": return 8$2; break;
case "Sep": return 9$2; break;
case "Oct": return 10$2; break;
case "Nov": return 11$2; break;
case "Dec": return 12$2; break;
}
}
{
d = date2time();
if (d >= from && d <= to)
print;
}
' file
Using array:
... oh see you have gotten your answer ;)
syslogdis a bit ambiguous (some syslog variations share that name for their main executable). Is this Mac OS X'ssyslogd?