aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/prog/split.awk
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-05-15 22:28:21 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-05-15 22:28:21 +0300
commit8b086817a7907d54dbe813f0dd05626b86e56cd1 (patch)
tree7e34a110a6e70581ffbebb3cbad8a1ff55a8f025 /awklib/eg/prog/split.awk
parentb34ea22faeecc99f81f4d897d5c4cc815eab2ddb (diff)
downloadegawk-8b086817a7907d54dbe813f0dd05626b86e56cd1.tar.gz
egawk-8b086817a7907d54dbe813f0dd05626b86e56cd1.tar.bz2
egawk-8b086817a7907d54dbe813f0dd05626b86e56cd1.zip
Edits through Chapter 11, fix displays for docbook.
Diffstat (limited to 'awklib/eg/prog/split.awk')
-rw-r--r--awklib/eg/prog/split.awk5
1 files changed, 3 insertions, 2 deletions
diff --git a/awklib/eg/prog/split.awk b/awklib/eg/prog/split.awk
index c907530b..bcc73ae6 100644
--- a/awklib/eg/prog/split.awk
+++ b/awklib/eg/prog/split.awk
@@ -4,8 +4,9 @@
#
# Arnold Robbins, arnold@skeeve.com, Public Domain
# May 1993
+# Revised slightly, May 2014
-# usage: split [-num] [file] [outname]
+# usage: split [-count] [file] [outname]
BEGIN {
outfile = "x" # default
@@ -14,7 +15,7 @@ BEGIN {
usage()
i = 1
- if (ARGV[i] ~ /^-[[:digit:]]+$/) {
+ if (i in ARGV && ARGV[i] ~ /^-[[:digit:]]+$/) {
count = -ARGV[i]
ARGV[i] = ""
i++