freebsd-dev/contrib/awk/awklib/eg/misc/findpat.sh
2000-08-15 10:02:07 +00:00

11 lines
224 B
Bash

awk '{
if ($1 == "FIND")
regex = $2
else {
where = match($0, regex)
if (where != 0)
print "Match of", regex, "found at", \
where, "in", $0
}
}'