Re: svn commit: r314942 - head/usr.bin/awk
Maybe you can bring them in here? :) Warner On Wed, Sep 13, 2017 at 12:37 PM, Pedro Giffuni wrote: > > > On 13/09/2017 13:15, John Baldwin wrote: > >> On Thursday, March 09, 2017 03:27:53 AM Baptiste Daroussin wrote: >> >>> Author: bapt >>> Date: Thu Mar 9 03:27:53 2017 >>> New Revision: 314942 >>> URL: https://svnweb.freebsd.org/changeset/base/314942 >>> >>> Log: >>>Import the awk(1) manpage from OpenBSD >>> As discussed during AsiaBSDcon devsummit, import the manpage from >>> OpenBSD which >>>is has been rewritten in mdoc(7) format making it readable by default >>> with >>>mandoc, it also has been extended by OpenBSD to cover all awk(1) >>> options >>> Obtained from:OpenBSD >>>MFH: 1 week >>> >> One problem noted today by imp@ is that this doesn't quite document the >> awk we >> ship: >> >> % echo 42 | awk '{ print lshift($1, 1) }' >> awk: calling undefined function lshift >> input record number 1, file >> source line number 1 >> >> None of the bit operations described in this manpage are implemented in >> one-true-awk. Hmm, it seems that OpenBSD added those as a local patch >> relative to one-true-awk in 1.10 of lex.c. So Someone(tm) needs to >> probably >> compare OpenBSD's awk to one-true-awk to see what local changes they have >> and either update the manpage here or pull the local diffs across. (I'd >> probably we just grab the implementation for the bitwise ops myself.) >> >> Hmm ... > > TBH, many years ago I tried to upstream the OpenBSD (actually gawk) > extensions but upstream (bwk) was not interested. > > Pedro. > > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r314942 - head/usr.bin/awk
On Wed, Sep 13, 2017 at 06:15:39PM +, John Baldwin wrote: > On Thursday, March 09, 2017 03:27:53 AM Baptiste Daroussin wrote: > > Author: bapt > > Date: Thu Mar 9 03:27:53 2017 > > New Revision: 314942 > > URL: https://svnweb.freebsd.org/changeset/base/314942 > > > > Log: > > Import the awk(1) manpage from OpenBSD > > > > As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD > > which > > is has been rewritten in mdoc(7) format making it readable by default with > > mandoc, it also has been extended by OpenBSD to cover all awk(1) options > > > > Obtained from:OpenBSD > > MFH: 1 week > > One problem noted today by imp@ is that this doesn't quite document the awk we > ship: > > % echo 42 | awk '{ print lshift($1, 1) }' > awk: calling undefined function lshift > input record number 1, file > source line number 1 > > None of the bit operations described in this manpage are implemented in > one-true-awk. Hmm, it seems that OpenBSD added those as a local patch > relative to one-true-awk in 1.10 of lex.c. So Someone(tm) needs to probably > compare OpenBSD's awk to one-true-awk to see what local changes they have > and either update the manpage here or pull the local diffs across. (I'd > probably we just grab the implementation for the bitwise ops myself.) > Good catch, I will have a look after eurobsdcon Best regards, Bapt signature.asc Description: PGP signature
Re: svn commit: r314942 - head/usr.bin/awk
On 13/09/2017 13:15, John Baldwin wrote: On Thursday, March 09, 2017 03:27:53 AM Baptiste Daroussin wrote: Author: bapt Date: Thu Mar 9 03:27:53 2017 New Revision: 314942 URL: https://svnweb.freebsd.org/changeset/base/314942 Log: Import the awk(1) manpage from OpenBSD As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which is has been rewritten in mdoc(7) format making it readable by default with mandoc, it also has been extended by OpenBSD to cover all awk(1) options Obtained from: OpenBSD MFH: 1 week One problem noted today by imp@ is that this doesn't quite document the awk we ship: % echo 42 | awk '{ print lshift($1, 1) }' awk: calling undefined function lshift input record number 1, file source line number 1 None of the bit operations described in this manpage are implemented in one-true-awk. Hmm, it seems that OpenBSD added those as a local patch relative to one-true-awk in 1.10 of lex.c. So Someone(tm) needs to probably compare OpenBSD's awk to one-true-awk to see what local changes they have and either update the manpage here or pull the local diffs across. (I'd probably we just grab the implementation for the bitwise ops myself.) Hmm ... TBH, many years ago I tried to upstream the OpenBSD (actually gawk) extensions but upstream (bwk) was not interested. Pedro. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r314942 - head/usr.bin/awk
On Thursday, March 09, 2017 03:27:53 AM Baptiste Daroussin wrote: > Author: bapt > Date: Thu Mar 9 03:27:53 2017 > New Revision: 314942 > URL: https://svnweb.freebsd.org/changeset/base/314942 > > Log: > Import the awk(1) manpage from OpenBSD > > As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD > which > is has been rewritten in mdoc(7) format making it readable by default with > mandoc, it also has been extended by OpenBSD to cover all awk(1) options > > Obtained from: OpenBSD > MFH:1 week One problem noted today by imp@ is that this doesn't quite document the awk we ship: % echo 42 | awk '{ print lshift($1, 1) }' awk: calling undefined function lshift input record number 1, file source line number 1 None of the bit operations described in this manpage are implemented in one-true-awk. Hmm, it seems that OpenBSD added those as a local patch relative to one-true-awk in 1.10 of lex.c. So Someone(tm) needs to probably compare OpenBSD's awk to one-true-awk to see what local changes they have and either update the manpage here or pull the local diffs across. (I'd probably we just grab the implementation for the bitwise ops myself.) -- John Baldwin ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r314942 - head/usr.bin/awk
[ Charset UTF-8 unsupported, converting... ] > Author: bapt > Date: Thu Mar 9 03:27:53 2017 > New Revision: 314942 > URL: https://svnweb.freebsd.org/changeset/base/314942 > > Log: > Import the awk(1) manpage from OpenBSD > > As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD > which > is has been rewritten in mdoc(7) format making it readable by default with > mandoc, it also has been extended by OpenBSD to cover all awk(1) options > > Obtained from: OpenBSD > MFH:1 week > > Added: > head/usr.bin/awk/awk.1 (contents, props changed) > > Added: head/usr.bin/awk/awk.1 > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/awk/awk.1Thu Mar 9 03:27:53 2017(r314942) > @@ -0,0 +1,794 @@ > +.\" $OpenBSD: awk.1,v 1.44 2015/09/14 20:06:58 schwarze Exp $ Please add a $FreeBSD$ to this? and update above to From: ... -- Rod Grimes rgri...@freebsd.org ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r314942 - head/usr.bin/awk
Author: bapt Date: Thu Mar 9 03:27:53 2017 New Revision: 314942 URL: https://svnweb.freebsd.org/changeset/base/314942 Log: Import the awk(1) manpage from OpenBSD As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which is has been rewritten in mdoc(7) format making it readable by default with mandoc, it also has been extended by OpenBSD to cover all awk(1) options Obtained from:OpenBSD MFH: 1 week Added: head/usr.bin/awk/awk.1 (contents, props changed) Added: head/usr.bin/awk/awk.1 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/awk/awk.1 Thu Mar 9 03:27:53 2017(r314942) @@ -0,0 +1,794 @@ +.\"$OpenBSD: awk.1,v 1.44 2015/09/14 20:06:58 schwarze Exp $ +.\" +.\" Copyright (C) Lucent Technologies 1997 +.\" All Rights Reserved +.\" +.\" Permission to use, copy, modify, and distribute this software and +.\" its documentation for any purpose and without fee is hereby +.\" granted, provided that the above copyright notice appear in all +.\" copies and that both that the copyright notice and this +.\" permission notice and warranty disclaimer appear in supporting +.\" documentation, and that the name Lucent Technologies or any of +.\" its entities not be used in advertising or publicity pertaining +.\" to distribution of the software without specific, written prior +.\" permission. +.\" +.\" LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +.\" INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +.\" IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +.\" SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +.\" THIS SOFTWARE. +.\" +.\"$FreeBSD$ +.Dd $Mdocdate: September 14 2015 $ +.Dt AWK 1 +.Os +.Sh NAME +.Nm awk +.Nd pattern-directed scanning and processing language +.Sh SYNOPSIS +.Nm awk +.Op Fl safe +.Op Fl V +.Op Fl d Ns Op Ar n +.Op Fl F Ar fs +.Op Fl v Ar var Ns = Ns Ar value +.Op Ar prog | Fl f Ar progfile +.Ar +.Sh DESCRIPTION +.Nm +scans each input +.Ar file +for lines that match any of a set of patterns specified literally in +.Ar prog +or in one or more files specified as +.Fl f Ar progfile . +With each pattern there can be an associated action that will be performed +when a line of a +.Ar file +matches the pattern. +Each line is matched against the +pattern portion of every pattern-action statement; +the associated action is performed for each matched pattern. +The file name +.Sq - +means the standard input. +Any +.Ar file +of the form +.Ar var Ns = Ns Ar value +is treated as an assignment, not a filename, +and is executed at the time it would have been opened if it were a filename. +.Pp +The options are as follows: +.Bl -tag -width "-safe " +.It Fl d Ns Op Ar n +Debug mode. +Set debug level to +.Ar n , +or 1 if +.Ar n +is not specified. +A value greater than 1 causes +.Nm +to dump core on fatal errors. +.It Fl F Ar fs +Define the input field separator to be the regular expression +.Ar fs . +.It Fl f Ar progfile +Read program code from the specified file +.Ar progfile +instead of from the command line. +.It Fl safe +Disable file output +.Pf ( Ic print No > , +.Ic print No >> ) , +process creation +.Po +.Ar cmd | Ic getline , +.Ic print | , +.Ic system +.Pc +and access to the environment +.Pf ( Va ENVIRON ; +see the section on variables below). +This is a first +.Pq and not very reliable +approximation to a +.Dq safe +version of +.Nm . +.It Fl V +Print the version number of +.Nm +to standard output and exit. +.It Fl v Ar var Ns = Ns Ar value +Assign +.Ar value +to variable +.Ar var +before +.Ar prog +is executed; +any number of +.Fl v +options may be present. +.El +.Pp +The input is normally made up of input lines +.Pq records +separated by newlines, or by the value of +.Va RS . +If +.Va RS +is null, then any number of blank lines are used as the record separator, +and newlines are used as field separators +(in addition to the value of +.Va FS ) . +This is convenient when working with multi-line records. +.Pp +An input line is normally made up of fields separated by whitespace, +or by the regular expression +.Va FS . +The fields are denoted +.Va $1 , $2 , ... , +while +.Va $0 +refers to the entire line. +If +.Va FS +is null, the input line is split into one field per character. +.Pp +Normally, any number of blanks separate fields. +In order to set the field separator to a single blank, use the +.Fl F +option with a value of +.Sq [\ \&] . +If a field separator of +.Sq t +is specified, +.Nm +treats it as if +.Sq \et +had been specified and uses +.Aq TAB +as the field separator. +In order to use a literal +.Sq t +as the field separator, use the +.Fl F +opti