aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/misc
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-09-27 22:33:01 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-09-27 22:33:01 +0300
commit9701514d4ad1152da564ebf6690c514becd4339a (patch)
tree69cf8c9a9991cb4f9fed6fbc2415f0605c52578e /awklib/eg/misc
parent6b1b9c16a1b55804df36457de0650414ab3f017d (diff)
parente71e74ac9af232d58e6c672e37ddf7e8737d68b1 (diff)
downloadegawk-9701514d4ad1152da564ebf6690c514becd4339a.tar.gz
egawk-9701514d4ad1152da564ebf6690c514becd4339a.tar.bz2
egawk-9701514d4ad1152da564ebf6690c514becd4339a.zip
Merge branch 'master' into comment
Diffstat (limited to 'awklib/eg/misc')
-rw-r--r--awklib/eg/misc/arraymax.awk10
-rw-r--r--awklib/eg/misc/findpat.awk13
2 files changed, 11 insertions, 12 deletions
diff --git a/awklib/eg/misc/arraymax.awk b/awklib/eg/misc/arraymax.awk
index 20dd1768..64197f56 100644
--- a/awklib/eg/misc/arraymax.awk
+++ b/awklib/eg/misc/arraymax.awk
@@ -1,10 +1,10 @@
{
- if ($1 > max)
- max = $1
- arr[$1] = $0
+ if ($1 > max)
+ max = $1
+ arr[$1] = $0
}
END {
- for (x = 1; x <= max; x++)
- print arr[x]
+ for (x = 1; x <= max; x++)
+ print arr[x]
}
diff --git a/awklib/eg/misc/findpat.awk b/awklib/eg/misc/findpat.awk
index e9bef9ea..9d799434 100644
--- a/awklib/eg/misc/findpat.awk
+++ b/awklib/eg/misc/findpat.awk
@@ -1,10 +1,9 @@
{
- if ($1 == "FIND")
- regex = $2
- else {
- where = match($0, regex)
- if (where != 0)
- print "Match of", regex, "found at",
- where, "in", $0
+ if ($1 == "FIND")
+ regex = $2
+ else {
+ where = match($0, regex)
+ if (where != 0)
+ print "Match of", regex, "found at", where, "in", $0
}
}