You might think wrong. Try it.
Like I already wrote, this is equivalent to
grep date file
For example,
grep 2008-04-20 traffic/127.0.0.1 would search for
2008-04-20 in the file
traffic/127.0.0.1.
Maybe your logs use a different date format, but you get the idea.
PS. Simpler still awk script, provided your date format doesn't have slashes in it:
Code:
#!/bin/sh
case $# in 0|1) echo "syntax: $0 date files ..." >&2; exit 2;; esac
date=$1
shift
awk "/$date/" "$@"