summaryrefslogtreecommitdiff
path: root/awklib/eg/misc/findpat.awk
blob: e9bef9eaf5d1a29e9d66663730b984f4536078d0 (plain)
1
2
3
4
5
6
7
8
9
10
{
       if ($1 == "FIND")
         regex = $2
       else {
         where = match($0, regex)
         if (where != 0)
           print "Match of", regex, "found at",
                     where, "in", $0
       }
}