Bot releases are hidden (Show)
Published by benhoyt almost 3 years ago
This release adds support for "getline lvalue" forms. See #85.
Published by benhoyt almost 3 years ago
This release changes the handling of the builtin functions length
, substr
, index
, and match
to use character indexes instead of byte indexes, as per the POSIX spec.
So this is a small backwards-incompatible change, but I think it's 1) warranted given GoAWK tries to conform to POSIX, and 2) won't break most scripts, even ones that use non-ASCII, unless they use constant indexes for substr
on non-ASCII strings. To revert to the previous bytes-index behavior, set interp.Config.Bytes
to true
when using from Go, or use the new goawk -b
option for the command-line version.
This does affect the performance of those builtins, as some operations that were O(1) are now O(N) in the length of the string. Still, v1.10.0 introduced other performance improvements, and it's pretty much a wash on the "real world" benchmarks overall.
See PR #83 and issue #35 for further discussion.
Published by benhoyt almost 3 years ago
This release includes a performance improvement and several bug fixes:
This release also adds the AWKGo AWK-to-Go compiler as described here, but it's a separate executable that doesn't change GoAWK itself at all. Read more about AWKGo.
Published by benhoyt almost 3 years ago
Fix builds on Go versions before 1.17 due to missing +build
constraint. Fixes https://github.com/benhoyt/goawk/issues/74.
Published by benhoyt almost 3 years ago
CLI: fix handling of "-" argument: https://github.com/benhoyt/goawk/issues/71
Published by benhoyt almost 3 years ago
Includes the following features and fixes:
getline <"-"
and print >"-"
: https://github.com/benhoyt/goawk/pull/63
ShellCommand
config option and change default to /bin/sh
(on Unix): https://github.com/benhoyt/goawk/pull/64
;
or newline separator: https://github.com/benhoyt/goawk/pull/68
Published by benhoyt about 3 years ago
Fix go install
bug due to presence of -ftest
file (see https://github.com/benhoyt/goawk/commit/0adcb1068d3f17cf59d50322e2e94aa3a2210617).
Published by benhoyt about 3 years ago
Published by benhoyt over 3 years ago
fflush()
: #42Published by benhoyt over 4 years ago
Fix the precedence handling when parsing unary operators, which fixes things like the "print unique lines" idiom !seen[$0]++
.
Thanks @sergeevabc. Fixes #33.
Published by benhoyt over 5 years ago
Fix handling of single-character FS.
Per POSIX spec (and the various implementations), a 1-char FS should be handled specially as a straight string split and not a regex. However, I had overlooked this, and was only doing this in the case of "\". This fixes things like FS="|" as reported by @shah in #29 (thanks!).
Bumped up minor version, seems like a fairly significant change rather than just a patch fix.
Also fix split() to have same behavior for single-char FS.
Fixes #29.
Published by benhoyt over 5 years ago
Change command line parsing to allow -F
and similar flags without a space between the option and the argument (allowed by POSIX), for example -F:
(thanks Arnold Robbins)
Also tweaked output of -version
to be just the bare version tag so it's machine-readable. -h
or --help
now includes the copyright message.
First release with binaries attached (see make_binaries.sh
). Thanks @cup.
Published by benhoyt over 5 years ago
Simplify exec calls to use in/out/err fields directly rather than pipe
Published by benhoyt over 5 years ago
Add config options for "safe mode" to prevent exec and file reads/writes. This is useful for running scripts from untrusted user input.
Published by benhoyt almost 6 years ago
Add support for delete array
(with no index). Fix bug with handling of (s)printf format string with three %
's in a row.
Published by benhoyt almost 6 years ago
Make a[x] array access set the element if not present (per POSIX spec). This seems unintuitive to me, but it's very clear in the spec, and awk/gawk/mawk all do this.
Published by benhoyt almost 6 years ago
Fix a number of issues found by running (most of) the gawk
test suite.
There are still a number of skipped GAWK tests (work to do), and some of GoAWK's behavior doesn't and won't ever match GAWK's 100%. I've gone for the POSIX behavior in most cases.
The full list of changes to GoAWK is:
\\
(as other AWKs do)Published by benhoyt almost 6 years ago
Fix scope issue when calling user function with global var
Published by benhoyt almost 6 years ago
Only split into fields when fields or NF
are accessed. This speeds up scripts that only access the line ($0
) and not individual fields.
Published by benhoyt almost 6 years ago
Fix resolving unknown var types when calling a native function. Thanks @Jeffail for reporting. Fixes #17.