Bug 206283 - Awk manpage fails to cite ampersand substitutions.
Summary: Awk manpage fails to cite ampersand substitutions.
Status: Closed Feedback Timeout
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Linimon
Depends on:
Reported: 2016-01-15 04:10 UTC by nibbana
Modified: 2020-08-15 03:43 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description nibbana 2016-01-15 04:10:26 UTC
FreeBSD 9.3: Awk manpage fails to cite the ampersand subsitution
operation that occurs in sub/gsub functions, eg:

$ echo damn! | awk '{ sub(/!/, "&&&"); print }'
Comment 1 nibbana 2016-09-19 11:49:14 UTC
The AWK manpage used to be fairly nice (10+ years ago), and it
really appears that somebody trashed it intentionally.  The
formatting is botched (wrapping around to the 1st column) and
there are stupid comments such as:

       There are no explicit conversions between numbers and
       strings.  To force an expression to be treated as a number
       add 0 to it; to force it to be treated as a string
       concatenate "" to it.  The scope rules for variables in
       functions are a botch; the syntax is worse.

That is just bullshit.  100% bullshit.  The implicit
conversions between numbers and strings is intentional, and
part of many more modern scripting languages.  And what is
wrong with the scope rules?  Variables are local to the
function; how is that a botch?  And what is so bad about the
syntax?  It's just a stupid comment intended to insult - the
obvious question is "for what purpose?"

Did the author create something better than K&R,
justifying such "authoritive insult?"  AWK is part of the
entire suite of Unix tools, and it is designed to do what
AWK is designed to do, as M4 is designed to do what it is
designed to do, and the same for SH, SED, YACC, LEX, PS ...
and in that role, is nearly flawless.  If anything is to
be criticized, it would properly be the failure to process
all 8-bit bytes equally (eg, without special consideration
to 0x0), or the fact that nawk closes stdin if requested,
or some other quirks that have been fixed in mawk/gawk.

AWK is a very important and critical part of the Unix tool
set, and honestly, this manpage is of highly inappropriate
quality in comparison.
Comment 2 Benedict Reuschling freebsd_committer 2017-03-09 12:08:00 UTC
The awk man page was imported from OpenBSD, which fixes formatting and should cover all awk(1) options.

Can you check whether that fixes your issue?
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2020-08-15 03:43:37 UTC
^Triage: this manual page is from upstream.  Hopefully after all these years the problem has been fixed.