Bug 241552

Summary: awk.1 man page incorrect about how to find awk's version
Product: Documentation Reporter: Andras Farkas <deepbluemistake>
Component: Manual PagesAssignee: Jason Helfman <jgh>
Status: Closed DUPLICATE    
Severity: Affects Many People CC: doc, gbe, jgh, samy.mahmoudi, wes
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247004

Description Andras Farkas 2019-10-28 20:39:32 UTC
The man page for awk(1) says you can find the version with awk -V
Instead, it seems you find the version with awk --version and awk -V does not work.
I don't have gawk or any other awk installed from ports or packages, so I know this is a bug.

$ awk -V
awk: unknown option -V ignored

awk: no program given

$ awk --version
awk version 20121220 (FreeBSD)
$ uname -a
FreeBSD nyann.tanasinn.mochi 12.0-RELEASE-p10 FreeBSD 12.0-RELEASE-p10 GENERIC  amd64
$ freebsd-version -kru
12.0-RELEASE-p10
12.0-RELEASE-p10
12.0-RELEASE-p11
Comment 1 Andras Farkas 2019-10-28 21:08:27 UTC
-version also works along with --version, by the way
Comment 2 Jason Helfman freebsd_committer freebsd_triage 2019-11-22 17:58:12 UTC
I'm looking into this.

awk -d

Will also work. Trying to evaluate the best approach and have pinged another developer that has worked with awk recently.
Comment 3 Samy Mahmoudi 2020-06-13 13:01:32 UTC
Hi all,

This is a duplicate of bug 230730.
Solved by another duplicate of bug 230730 (bug 247004):

Author: yuripv
Date: Sat Jun 13 09:16:07 2020
New Revision: 362147
URL: https://svnweb.freebsd.org/changeset/base/362147

Log:
  awk(1): use -version instead of -V

  -V is OpenBSD specific, use -version instead.

  While here, fix issue reported by mandoc lint and drop nonexistent
  script(7) reference.

  PR:           247004
  Reviewed by:  0mp, markj
  Differential Revision:        https://reviews.freebsd.org/D25164

Modified:
  head/usr.bin/awk/awk.1
Comment 4 Gordon Bergling freebsd_committer freebsd_triage 2020-07-14 20:30:00 UTC
Samy Mahmoudi, thanks for the comment about the duplicate.

*** This bug has been marked as a duplicate of bug 247004 ***
Comment 5 Samy Mahmoudi 2020-07-14 22:00:37 UTC
(In reply to Gordon Bergling from comment #4)
You are welcome Gordon.