diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2020-11-28 20:48:43 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2020-11-28 20:48:43 +0200 |
commit | 45c17dbafdca47c53e812008bade3f7a13115756 (patch) | |
tree | d003631a8d08cbc9975739e03908dfd7d7316c40 /awklib | |
parent | dff7cb280f153e71d2ed187521da52c3fca04fe5 (diff) | |
download | egawk-45c17dbafdca47c53e812008bade3f7a13115756.tar.gz egawk-45c17dbafdca47c53e812008bade3f7a13115756.tar.bz2 egawk-45c17dbafdca47c53e812008bade3f7a13115756.zip |
More edits in sample programs chapter.
Diffstat (limited to 'awklib')
-rw-r--r-- | awklib/eg/prog/cut.awk | 2 | ||||
-rw-r--r-- | awklib/eg/prog/split.awk | 8 | ||||
-rw-r--r-- | awklib/eg/prog/uniq.awk | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/awklib/eg/prog/cut.awk b/awklib/eg/prog/cut.awk index 1ec89288..b0987b3a 100644 --- a/awklib/eg/prog/cut.awk +++ b/awklib/eg/prog/cut.awk @@ -4,9 +4,9 @@ # May 1993 # Options: +# -c list Cut characters # -f list Cut fields # -d c Field delimiter character -# -c list Cut characters # # -s Suppress lines without the delimiter # diff --git a/awklib/eg/prog/split.awk b/awklib/eg/prog/split.awk index 8714dad2..16780044 100644 --- a/awklib/eg/prog/split.awk +++ b/awklib/eg/prog/split.awk @@ -7,10 +7,12 @@ # Revised slightly, May 2014 # Rewritten September 2020 -function usage() + +function usage( common) { - print("usage: split [-l count] [-a suffix-len] [file [outname]]") > "/dev/stderr" - print(" split [-b N[k|m]] [-a suffix-len] [file [outname]]") > "/dev/stderr" + common = "[-a suffix-len] [file [outname]]" + printf("usage: split [-l count] %s\n", common) > "/dev/stderr" + printf(" split [-b N[k|m]] %s\n", common) > "/dev/stderr" exit 1 } BEGIN { diff --git a/awklib/eg/prog/uniq.awk b/awklib/eg/prog/uniq.awk index 57c98f2c..e614bf2b 100644 --- a/awklib/eg/prog/uniq.awk +++ b/awklib/eg/prog/uniq.awk @@ -8,7 +8,8 @@ function usage() { - print("Usage: uniq [-udc [-f fields] [-s chars]] [ in [ out ]]") > "/dev/stderr" + print("Usage: uniq [-udc [-f fields] [-s chars]] " \ + "[ in [ out ]]") > "/dev/stderr" exit 1 } @@ -17,7 +18,7 @@ function usage() # -u only nonrepeated lines # -f n skip n fields # -s n skip n characters, skip fields first -# As of 2020, '+' can be used as option character in addition to '-' +# As of 2020, '+' can be used as the option character in addition to '-' # Previously allowed use of -N to skip fields and +N to skip # characters is no longer allowed, and not supported by this version. |