aboutsummaryrefslogtreecommitdiffstats
path: root/awklib
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-06-23 20:30:13 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-06-23 20:30:13 +0300
commit98ef29fdcadffc0a05c91883c4ab8809a8b0d441 (patch)
tree9187c5f7e94f956ee29ff54c79d5ddf825cc7fc0 /awklib
parent1bf8a67c114568b307c1df6dfe2042e2a3eab49b (diff)
downloadegawk-98ef29fdcadffc0a05c91883c4ab8809a8b0d441.tar.gz
egawk-98ef29fdcadffc0a05c91883c4ab8809a8b0d441.tar.bz2
egawk-98ef29fdcadffc0a05c91883c4ab8809a8b0d441.zip
More doc updates.
Diffstat (limited to 'awklib')
-rw-r--r--awklib/eg/lib/isnumeric.awk23
-rw-r--r--awklib/eg/prog/split.awk2
2 files changed, 15 insertions, 10 deletions
diff --git a/awklib/eg/lib/isnumeric.awk b/awklib/eg/lib/isnumeric.awk
index 6309e76a..c2699022 100644
--- a/awklib/eg/lib/isnumeric.awk
+++ b/awklib/eg/lib/isnumeric.awk
@@ -2,13 +2,18 @@
function isnumeric(x, f)
{
- switch (typeof(x)) {
- case "strnum":
- case "number":
- return 1
- case "string":
- return (split(x, f, " ") == 1) && (typeof(f[1]) == "strnum")
- default:
- return 0
- }
+ switch (typeof(x)) {
+ case "strnum":
+ case "number":
+ return 1
+ case "string":
+ return (split(x, f, " ") == 1) && (typeof(f[1]) == "strnum")
+ default:
+ return 0
+ }
}
+
+Please note that leading or trailing white space is disregarded in deciding
+whether a value is numeric or not, so if it matters to you, you may want
+to add an additional check for that.
+
diff --git a/awklib/eg/prog/split.awk b/awklib/eg/prog/split.awk
index 16780044..4804de5f 100644
--- a/awklib/eg/prog/split.awk
+++ b/awklib/eg/prog/split.awk
@@ -8,7 +8,7 @@
# Rewritten September 2020
-function usage( common)
+function usage( common)
{
common = "[-a suffix-len] [file [outname]]"
printf("usage: split [-l count] %s\n", common) > "/dev/stderr"