diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 14:40:49 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 14:40:49 +0300 |
commit | 85c0d5edb781c9f31b79e48452b1ca68643f41de (patch) | |
tree | 14efbc59b30cdd626a208d6391f3ed226387054e /test/longwrds.awk | |
parent | 6cc7d587a710606d3fe52222707739c7cc1b8651 (diff) | |
download | egawk-85c0d5edb781c9f31b79e48452b1ca68643f41de.tar.gz egawk-85c0d5edb781c9f31b79e48452b1ca68643f41de.tar.bz2 egawk-85c0d5edb781c9f31b79e48452b1ca68643f41de.zip |
Move to gawk-3.1.4.
Diffstat (limited to 'test/longwrds.awk')
-rw-r--r-- | test/longwrds.awk | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/longwrds.awk b/test/longwrds.awk index d496ac79..d4b4d92d 100644 --- a/test/longwrds.awk +++ b/test/longwrds.awk @@ -1,4 +1,10 @@ # From Gawk Manual modified by bug fix and removal of punctuation + +# Invoker can customize sort command if necessary. +BEGIN { + if (!SORT) SORT = "LC_ALL=C sort" +} + # Record every word which is used at least once { for (i = 1; i <= NF; i++) { @@ -14,8 +20,8 @@ END { for (x in used) if (length(x) > 10) { ++num_long_words - print x | "LC_ALL=C sort" + print x | SORT } - print(num_long_words, "long words") | "LC_ALL=C sort" - close("LC_ALL=C sort") + print(num_long_words, "long words") | SORT + close(SORT) } |