aboutsummaryrefslogtreecommitdiffstats
path: root/awklib
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-03-30 23:25:17 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-03-30 23:25:17 +0200
commit089e787a5a970f8005cf4ee34b152bf1747b14b0 (patch)
tree0d4783a31e782e02b429d5715d149a5e3df3b813 /awklib
parent0a4c1c5344b5d6c1750708675901509210497761 (diff)
downloadegawk-089e787a5a970f8005cf4ee34b152bf1747b14b0.tar.gz
egawk-089e787a5a970f8005cf4ee34b152bf1747b14b0.tar.bz2
egawk-089e787a5a970f8005cf4ee34b152bf1747b14b0.zip
More documentation edits.
Diffstat (limited to 'awklib')
-rw-r--r--awklib/eg/prog/alarm.awk2
-rw-r--r--awklib/eg/prog/cut.awk4
-rw-r--r--awklib/eg/prog/igawk.sh2
-rw-r--r--awklib/eg/prog/uniq.awk4
4 files changed, 6 insertions, 6 deletions
diff --git a/awklib/eg/prog/alarm.awk b/awklib/eg/prog/alarm.awk
index 2510c787..53563d15 100644
--- a/awklib/eg/prog/alarm.awk
+++ b/awklib/eg/prog/alarm.awk
@@ -30,7 +30,7 @@ BEGIN \
message = ARGV[2]
break
default:
- if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]][[:digit:]]/) {
+ if (ARGV[1] !~ /[[:digit:]]?[[:digit:]]:[[:digit:]]{2}/) {
print usage1 > "/dev/stderr"
print usage2 > "/dev/stderr"
exit 1
diff --git a/awklib/eg/prog/cut.awk b/awklib/eg/prog/cut.awk
index 91a13a4e..fb4717c1 100644
--- a/awklib/eg/prog/cut.awk
+++ b/awklib/eg/prog/cut.awk
@@ -10,7 +10,7 @@
#
# -s Suppress lines without the delimiter
#
-# Requires getopt and join library functions
+# Requires getopt() and join() library functions
function usage( e1, e2)
{
@@ -96,7 +96,7 @@ function set_charlist( field, i, j, f, g, t,
if (index(f[i], "-") != 0) { # range
m = split(f[i], g, "-")
if (m != 2 || g[1] >= g[2]) {
- printf("bad bracket expression: %s\n",
+ printf("bad character list: %s\n",
f[i]) > "/dev/stderr"
exit 1
}
diff --git a/awklib/eg/prog/igawk.sh b/awklib/eg/prog/igawk.sh
index 6657e5d8..bd9d9ac8 100644
--- a/awklib/eg/prog/igawk.sh
+++ b/awklib/eg/prog/igawk.sh
@@ -128,7 +128,7 @@ BEGIN {
}
}' # close quote ends `expand_prog' variable
-processed_program=$(gawk -- "$expand_prog" /dev/stdin <<EOF
+processed_program=$(gawk -- "$expand_prog" /dev/stdin << EOF
$program
EOF
)
diff --git a/awklib/eg/prog/uniq.awk b/awklib/eg/prog/uniq.awk
index 07d9b9e8..990387ac 100644
--- a/awklib/eg/prog/uniq.awk
+++ b/awklib/eg/prog/uniq.awk
@@ -33,7 +33,7 @@ BEGIN \
else if (index("0123456789", c) != 0) {
# getopt requires args to options
# this messes us up for things like -5
- if (Optarg ~ /^[0-9]+$/)
+ if (Optarg ~ /^[[:digit:]]+$/)
fcount = (c Optarg) + 0
else {
fcount = c + 0
@@ -43,7 +43,7 @@ BEGIN \
usage()
}
- if (ARGV[Optind] ~ /^\+[0-9]+$/) {
+ if (ARGV[Optind] ~ /^\+[[:digit:]]+$/) {
charcount = substr(ARGV[Optind], 2) + 0
Optind++
}