diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-11-03 14:40:38 -0500 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2014-11-03 14:40:38 -0500 |
commit | 6a9d48365f5044b64a6c270760808d17d475ca4b (patch) | |
tree | d612b2410fe9af333a79e524f5e5102f9754feed /awklib/eg/misc | |
parent | b4d06df669e1eaf6c98cacb5c5f299bb5324e804 (diff) | |
parent | 204bec7af64c61489e37007d45de936482007977 (diff) | |
download | egawk-6a9d48365f5044b64a6c270760808d17d475ca4b.tar.gz egawk-6a9d48365f5044b64a6c270760808d17d475ca4b.tar.bz2 egawk-6a9d48365f5044b64a6c270760808d17d475ca4b.zip |
Merge remote-tracking branch 'origin/master' into select
Diffstat (limited to 'awklib/eg/misc')
-rw-r--r-- | awklib/eg/misc/arraymax.awk | 10 | ||||
-rw-r--r-- | awklib/eg/misc/findpat.awk | 13 |
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 } } |