From bc70de7b3302d5a81515b901cae376b8b51d2004 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 16 Jul 2010 13:09:56 +0300 Subject: Move to gawk-3.1.0. --- awklib/eg/misc/findpat.awk | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 awklib/eg/misc/findpat.awk (limited to 'awklib/eg/misc/findpat.awk') diff --git a/awklib/eg/misc/findpat.awk b/awklib/eg/misc/findpat.awk new file mode 100644 index 00000000..e9bef9ea --- /dev/null +++ b/awklib/eg/misc/findpat.awk @@ -0,0 +1,10 @@ +{ + if ($1 == "FIND") + regex = $2 + else { + where = match($0, regex) + if (where != 0) + print "Match of", regex, "found at", + where, "in", $0 + } +} -- cgit v1.2.3