Name
Date
Size
#Lines
LOC

..--

USD.doc/H--1,4821,407

FIXESH A D03-Aug-20245.4 KiB135108

FIXES.1eH A D03-Jun-202449.1 KiB1,4301,090

LICENSEH A D17-Sep-20231.1 KiB2421

MakefileH A D03-Jun-2024628 2416

README.mdH A D03-Jun-20245.2 KiB138100

awk.1H A D25-Dec-202423.2 KiB1,0841,083

awk.hH A D03-Jun-20247.7 KiB286200

awkgram.yH A D10-Sep-202314.7 KiB517435

b.cH A D03-Aug-202437.4 KiB1,5711,252

lex.cH A D03-Jun-202414.6 KiB670586

lib.cH A D03-Aug-202422.8 KiB932770

main.cH A D03-Aug-20248 KiB327274

maketab.cH A D22-Nov-20235.8 KiB195153

parse.cH A D10-Sep-20235.5 KiB301227

proto.hH A D03-Jun-20247.4 KiB209173

run.cH A D04-Jun-202464.6 KiB2,8652,470

tran.cH A D03-Jun-202417.3 KiB655546

README.md

1# OpenBSD Awk
2
3This is a fork of The One True Awk, as shipped with OpenBSD.  It
4includes changes not present in the upstream version because they
5are OpenBSD-specific, are still open PRs, or were rejected by the
6upstream maintainer.  This version of `awk` relies on APIs that are
7not present in some other systems, such as `asprintf`, `pledge`,
8`reallocarray`, `srandom_deterministic` and `strlcpy`.
9
10## What is upstream? ##
11
12Upstream is the bsd-features branch of https://github.com/onetrueawk/awk.
13
14This is the version of `awk` described in _The AWK Programming Language_,
15Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger
16(Addison-Wesley, 2024, ISBN-13 978-0138269722, ISBN-10 0138269726).
17
18## What's New? ##
19
20This version of Awk handles UTF-8 and comma-separated values (CSV) input.
21
22### Strings ###
23
24Functions that process strings now count Unicode code points, not bytes;
25this affects `length`, `substr`, `index`, `match`, `split`,
26`sub`, `gsub`, and others.  Note that code
27points are not necessarily characters.
28
29UTF-8 sequences may appear in literal strings and regular expressions.
30Arbitrary characters may be included with `\u` followed by 1 to 8 hexadecimal digits.
31
32### Regular expressions ###
33
34Regular expressions may include UTF-8 code points, including `\u`.
35
36### CSV ###
37
38The option `--csv` turns on CSV processing of input:
39fields are separated by commas, fields may be quoted with
40double-quote (`"`) characters, quoted fields may contain embedded newlines.
41Double-quotes in fields have to be doubled and enclosed in quoted fields.
42In CSV mode, `FS` is ignored.
43
44If no explicit separator argument is provided,
45field-splitting in `split` is determined by CSV mode.
46
47## Copyright
48
49Copyright (C) Lucent Technologies 1997<br/>
50All Rights Reserved
51
52Permission to use, copy, modify, and distribute this software and
53its documentation for any purpose and without fee is hereby
54granted, provided that the above copyright notice appear in all
55copies and that both that the copyright notice and this
56permission notice and warranty disclaimer appear in supporting
57documentation, and that the name Lucent Technologies or any of
58its entities not be used in advertising or publicity pertaining
59to distribution of the software without specific, written prior
60permission.
61
62LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
63INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
64IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
65SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
66WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
67IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
68ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
69THIS SOFTWARE.
70
71## Distribution and Reporting Problems
72
73Changes, mostly bug fixes and occasional enhancements, are listed
74in `FIXES`.  If you distribute this code further, please please please
75distribute `FIXES` with it.
76
77If you find errors, please report them to bugs@openbsd.org rather
78than the upstream maintainer unless you can also reproduce the
79problem with an unmodified version of the upstream awk.
80
81## Submitting Patches
82
83Patches may be submitted to the tech@openbsd.org mailing list, or
84bugs@openbsd.org if you are fixing a bug.
85
86## Building
87
88The program itself is created by
89
90	make
91
92which should produce a sequence of messages roughly like this:
93
94	bison -d  awkgram.y
95	awkgram.y: warning: 44 shift/reduce conflicts [-Wconflicts-sr]
96	awkgram.y: warning: 85 reduce/reduce conflicts [-Wconflicts-rr]
97	awkgram.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
98	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o awkgram.tab.o awkgram.tab.c
99	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o b.o b.c
100	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o main.o main.c
101	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o parse.o parse.c
102	gcc -g -Wall -pedantic -Wcast-qual -O2 maketab.c -o maketab
103	./maketab awkgram.tab.h >proctab.c
104	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o proctab.o proctab.c
105	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o tran.o tran.c
106	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o lib.o lib.c
107	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o run.o run.c
108	gcc -g -Wall -pedantic -Wcast-qual   -O2   -c -o lex.o lex.c
109	gcc -g -Wall -pedantic -Wcast-qual   -O2 awkgram.tab.o b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o   -lm
110
111This produces an executable `a.out`; you will eventually want to
112move this to some place like `/usr/bin/awk`.
113
114If your system does not have `yacc` or `bison` (the GNU
115equivalent), you need to install one of them first.
116The default in the `makefile` is `bison`; you will have
117to edit the `makefile` to use `yacc`.
118
119NOTE: This version uses ISO/IEC C99, as you should also.  We have
120compiled this without any changes using `gcc -Wall` and/or local C
121compilers on a variety of systems, but new systems or compilers
122may raise some new complaint; reports of difficulties are
123welcome.
124
125This compiles without change on Macintosh OS X using `gcc` and
126the standard developer tools.
127
128You can also use `make CC=g++` to build with the GNU C++ compiler,
129should you choose to do so.
130
131## A Note About Releases
132
133We don't usually do releases.
134
135#### Last Updated
136
137Mon 05 Feb 2024 08:46:55 IST
138