aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg
diff options
context:
space:
mode:
Diffstat (limited to 'awklib/eg')
-rw-r--r--awklib/eg/prog/cut.awk4
-rw-r--r--awklib/eg/prog/wc.awk2
2 files changed, 3 insertions, 3 deletions
diff --git a/awklib/eg/prog/cut.awk b/awklib/eg/prog/cut.awk
index 080279bc..fd77910d 100644
--- a/awklib/eg/prog/cut.awk
+++ b/awklib/eg/prog/cut.awk
@@ -35,7 +35,7 @@ BEGIN {
" for delimiter\n", Optarg) > "/dev/stderr"
Optarg = substr(Optarg, 1, 1)
}
- FS = Optarg
+ fs = FS = Optarg
OFS = FS
if (FS == " ") # defeat awk semantics
FS = "[ ]"
@@ -123,7 +123,7 @@ function set_charlist( field, i, j, f, g, n, m, t,
nfields = j - 1
}
{
- if (by_fields && suppress && index($0, FS) == 0)
+ if (by_fields && suppress && index($0, fs) == 0)
next
for (i = 1; i <= nfields; i++) {
diff --git a/awklib/eg/prog/wc.awk b/awklib/eg/prog/wc.awk
index 95940ae4..c46d0984 100644
--- a/awklib/eg/prog/wc.awk
+++ b/awklib/eg/prog/wc.awk
@@ -30,7 +30,7 @@ BEGIN {
if (! do_lines && ! do_words && ! do_chars)
do_lines = do_words = do_chars = 1
- print_total = (ARGC - i > 2)
+ print_total = (ARGC - i > 1)
}
function beginfile(file)
{