Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/awk substr(): the argument 'n' is optional, document...



details:   https://anonhg.NetBSD.org/src/rev/ed07e83f7760
branches:  trunk
changeset: 503318:ed07e83f7760
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Feb 04 20:47:50 2001 +0000

description:
substr(): the argument 'n' is optional, document what happens if it's omitted
fix order of OFS and ORS in variable list

diffstat:

 usr.bin/awk/awk.1 |  24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diffs (52 lines):

diff -r cfc904300c82 -r ed07e83f7760 usr.bin/awk/awk.1
--- a/usr.bin/awk/awk.1 Sun Feb 04 20:44:53 2001 +0000
+++ b/usr.bin/awk/awk.1 Sun Feb 04 20:47:50 2001 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: awk.1,v 1.2 2001/01/30 21:05:12 jdolecek Exp $
+.\"    $NetBSD: awk.1,v 1.3 2001/02/04 20:47:50 jdolecek Exp $
 .\"
 .\" Copyright (C) Lucent Technologies 1997
 .\" All Rights Reserved
@@ -364,14 +364,18 @@
 is not given,
 .Va $0
 is used.
-.It Fn substr s m n
-the
+.It Fn substr s m [n]
+Returns the at most
 .Ar n -character
 substring of
 .Ar s
-that begins at position
-.Ar m
-counted from 1.
+starting at position
+.Ar m ,
+counted from 1. If
+.Ar n
+is omitted, the rest of
+.Ar s
+is returned.
 .It Fn tolower str
 returns a copy of
 .Ar str
@@ -478,14 +482,14 @@
 number of fields in the current record
 .It Va NR
 ordinal number of the current record
+.It Va OFMT
+output format for numbers (default
+.Qq "%.6g"
+)
 .It Va OFS
 output field separator (default blank)
 .It Va ORS
 output record separator (default newline)
-.It Va OFMT
-output format for numbers (default
-.Qq "%.6g"
-)
 .It Va RS
 input record separator (default newline)
 .It Va SUBSEP



Home | Main Index | Thread Index | Old Index