diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-10-13 11:27:13 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-10-13 11:27:13 +0300 |
commit | 0485d6bfe2417a7640ef95c9de6f48e1f35003fd (patch) | |
tree | f26c8a24a4a12bf9be5038f40e6a20a4f6e9aa79 /awklib/eg/prog/uniq.awk | |
parent | 7504a8fbc86b327ad07c79c943b8fe2d253f256d (diff) | |
parent | 2a8c128ca91b42261720368e5d25431ee4362c70 (diff) | |
download | egawk-0485d6bfe2417a7640ef95c9de6f48e1f35003fd.tar.gz egawk-0485d6bfe2417a7640ef95c9de6f48e1f35003fd.tar.bz2 egawk-0485d6bfe2417a7640ef95c9de6f48e1f35003fd.zip |
Merge branch 'master' into cmake
Diffstat (limited to 'awklib/eg/prog/uniq.awk')
-rw-r--r-- | awklib/eg/prog/uniq.awk | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/awklib/eg/prog/uniq.awk b/awklib/eg/prog/uniq.awk index 990387ac..7dd16099 100644 --- a/awklib/eg/prog/uniq.awk +++ b/awklib/eg/prog/uniq.awk @@ -5,10 +5,9 @@ # Arnold Robbins, arnold@skeeve.com, Public Domain # May 1993 -function usage( e) +function usage() { - e = "Usage: uniq [-udc [-n]] [+n] [ in [ out ]]" - print e > "/dev/stderr" + print("Usage: uniq [-udc [-n]] [+n] [ in [ out ]]") > "/dev/stderr" exit 1 } @@ -18,8 +17,7 @@ function usage( e) # -n skip n fields # +n skip n characters, skip fields first -BEGIN \ -{ +BEGIN { count = 1 outputfile = "/dev/stdout" opts = "udc0:1:2:3:4:5:6:7:8:9:" @@ -31,7 +29,7 @@ BEGIN \ else if (c == "c") do_count++ else if (index("0123456789", c) != 0) { - # getopt requires args to options + # getopt() requires args to options # this messes us up for things like -5 if (Optarg ~ /^[[:digit:]]+$/) fcount = (c Optarg) + 0 |