freebsd-dev/contrib/awk/awklib/eg/misc/findpat.sh

11 lines
224 B
Bash
Raw Normal View History

2000-08-15 10:02:07 +00:00
awk '{
if ($1 == "FIND")
regex = $2
else {
where = match($0, regex)
if (where != 0)
print "Match of", regex, "found at", \
where, "in", $0
}
}'