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