Re: awk doesn't build on armv7

2022-02-02 Thread Jan Stary
On Feb 02 11:49:50, stu.li...@spacehopper.org wrote: > On 2022-02-02, Jan Stary wrote: > > #define noreturn __dead > > #else > > #include > > #endif > > > > and stdnoreturn.h indeed does not exist. > > Where are you looking? It should be in >

Re: awk doesn't build on armv7

2022-02-02 Thread Stuart Henderson
On 2022-02-02, Jan Stary wrote: > #define noreturn __dead > #else > #include > #endif > > and stdnoreturn.h indeed does not exist. Where are you looking? It should be in /usr/lib/clang/13.0.0/include/stdnoreturn.h.

Re: awk doesn't build on armv7

2022-02-02 Thread Theo de Raadt
Builds fine for me. Jan Stary wrote: > This is current/armv7 on a Beagle Bone Black (dmesg below). > make build just failed in usr.bin/awk with > > ===> usr.bin/awk > yacc -o awkgram.tab.c -d /usr/src/usr.bin/awk/awkgram.y > /usr/src/usr.bin/awk/awkgram.y: yacc finds 62 s

awk doesn't build on armv7

2022-02-02 Thread Jan Stary
This is current/armv7 on a Beagle Bone Black (dmesg below). make build just failed in usr.bin/awk with ===> usr.bin/awk yacc -o awkgram.tab.c -d /usr/src/usr.bin/awk/awkgram.y /usr/src/usr.bin/awk/awkgram.y: yacc finds 62 shift/reduce conflicts /usr/src/usr.bin/awk/awkgram.y: yacc finds

switch to the official awk link

2021-07-24 Thread Franco Leiva
@@ The terms of this license are identical Additionally, OpenBSD includes some other ATT code with non-restrictive copyrights, such as the reference implementation of -http://cm.bell-labs.com/cm/cs/who/bwk/awk.tar.gz;>awk. +https://github.com/onetrueawk/awk;>awk. Caldera ? awk.diff Index: polic

Re: Another potential awk or xargs bug?

2021-04-16 Thread Otto Moerbeek
with a fragment from a line written by process #1, followed by > >> lines from process #2, followed by the remainder of the line from > >> #1, etc. > >> > >> -- > >> Christian "naddy" Weisgerber na...@mips.inka.de > &

Re: Another potential awk or xargs bug?

2021-04-16 Thread Jordan Geoghegan
; -- >> Christian "naddy" Weisgerber na...@mips.inka.de >> > Right, a fflush() call after the printf makes the issue go away, but > only since awk is being nice and issues a single write call for that > single printf. Since awk afaik does not give such

Re: Another potential awk or xargs bug?

2021-04-15 Thread Otto Moerbeek
end > up with a fragment from a line written by process #1, followed by > lines from process #2, followed by the remainder of the line from > #1, etc. > > -- > Christian "naddy" Weisgerber na...@mips.inka.de > Right, a fflush() call after

Re: Another potential awk or xargs bug?

2021-04-15 Thread Christian Weisgerber
Jordan Geoghegan: > --- /tmp/bad.txt  Wed Apr 14 21:06:51 2021 > +++ /tmp/good.txt  Wed Apr 14 21:06:41 2021 I'll note that no characters have been lost between the two files. Only the order is different. > The only thing that changed between these runs was me using either xargs -P 1 > or -P

Another potential awk or xargs bug?

2021-04-15 Thread Jordan Geoghegan
Hello, I've found some very interesting behaviour when subjecting various awk implementations to some very specific circumstances. I'm basically looking for a sanity check here to confirm if I'm just wildly flailing, or if I am indeed onto something here. Here's my situation: When parsing

Re: awk segfaults on RS regexp

2020-07-13 Thread Todd C . Miller
On Mon, 13 Jul 2020 13:02:44 +0200, Jan Stary wrote: > This is current/amd64. > > On UTF input, awk segfaults when using a multi-character RS: > > $ cat /tmp/in > č > > $ hexdump -C /tmp/in > c4 8d 0a|...| > 00

awk segfaults on RS regexp

2020-07-13 Thread Jan Stary
This is current/amd64. On UTF input, awk segfaults when using a multi-character RS: $ cat /tmp/in č $ hexdump -C /tmp/in c4 8d 0a |...| 0003 $ cat /tmp/in | awk '{print$1}' č $ cat /tmp/in | awk -v RS=x '{print$1}' č $ cat /tmp/in | awk

Re: Potential awk bug?

2020-06-13 Thread Jordan Geoghegan
I be reporting this bug upstream, or are you planning on upstreaming a diff? I've created a pull request to fix this upstream: https://github.com/onetrueawk/awk/pull/80 - todd Sorry for the late reply, I've been AFK for the last week. Excited to see base system awk get synced

Re: Potential awk bug?

2020-06-13 Thread Stuart Henderson
Should I be reporting this bug upstream, or are >>> you planning on upstreaming a diff? >> I've created a pull request to fix this upstream: >> https://github.com/onetrueawk/awk/pull/80 >> >> - todd > > Sorry for the late reply, I've been AFK for the

Re: Potential awk bug?

2020-06-12 Thread Jordan Geoghegan
created a pull request to fix this upstream: https://github.com/onetrueawk/awk/pull/80 - todd Sorry for the late reply, I've been AFK for the last week. Excited to see base system awk get synced with upstream. Kudos to you and Philip for such a swift and effective response. Regards

Re: Potential awk bug?

2020-06-08 Thread Todd C . Miller
upstream: https://github.com/onetrueawk/awk/pull/80 - todd

Re: Potential awk bug?

2020-06-07 Thread Jordan Geoghegan
<mailto:zel...@zeloff.org>> wrote: On Sat, Jun 06, 2020 at 03:51:58PM -0700, Jordan Geoghegan wrote: > I'm working on a simple awk snippet to convert the IP range data listed in > the Extended Delegation Statistics data from ARIN [1] and convert it into &

Re: Potential awk bug?

2020-06-07 Thread Todd C . Miller
On Sat, 06 Jun 2020 18:16:39 -0900, Philip Guenther wrote: > Todd, are we up to date with upstream, or is this latent there too? We are not up to date but upstream (https://github.com/onetrueawk/awk) exhibits the same bug. - todd

Re: Potential awk bug?

2020-06-06 Thread Theo de Raadt
I was halfway there. That's an old bug. Philip Guenther wrote: > On Sat, Jun 6, 2020 at 5:08 PM Zé Loff wrote: > > > On Sat, Jun 06, 2020 at 03:51:58PM -0700, Jordan Geoghegan wrote: > > > I'm working on a simple awk snippet to convert the IP range data listed >

Re: Potential awk bug?

2020-06-06 Thread Philip Guenther
On Sat, Jun 6, 2020 at 5:08 PM Zé Loff wrote: > On Sat, Jun 06, 2020 at 03:51:58PM -0700, Jordan Geoghegan wrote: > > I'm working on a simple awk snippet to convert the IP range data listed > in > > the Extended Delegation Statistics data from ARIN [1] and convert it into >

Re: Potential awk bug?

2020-06-06 Thread Zé Loff
On Sat, Jun 06, 2020 at 03:51:58PM -0700, Jordan Geoghegan wrote: > Hello, > > I was hoping the fine folks here could give me a quick sanity check, I'm by > no means an awk guru, so I'm likely missing something obvious. I wanted to > ask here quickly before I started flapping

Potential awk bug?

2020-06-06 Thread Jordan Geoghegan
Hello, I was hoping the fine folks here could give me a quick sanity check, I'm by no means an awk guru, so I'm likely missing something obvious. I wanted to ask here quickly before I started flapping my gums on bugs@. I'm working on a simple awk snippet to convert the IP range data listed

Re: Fun play with egrep, sed and awk

2019-12-27 Thread goleo .
e. > > After a few minutes running and just ~1.7MiB of HTML downloaded, it > tried to recurse into a lot of non-existing directories, so I cut it > short there. The figure may not be perfect. > > $ grep -E '[0-9]$' everything.html | sed 's|.* \([0-9]*\)$|\1|' | awk > '{sum+=$1} END{pr

Re: Fun play with egrep, sed and awk

2019-12-27 Thread Guilherme Janczak
rt there. The figure may not be perfect. $ grep -E '[0-9]$' everything.html | sed 's|.* \([0-9]*\)$|\1|' | awk '{sum+=$1} END{print sum / 1024 / 1024}' 65629 The sum of all filesizes, which are listed in kebibytes, divided by 1024^2, to turn it into gibibytes, returns 65629 gibibytes or about 65 tebib

Re: Fun play with egrep, sed and awk

2019-12-27 Thread Stuart Henderson
nger used by a port. > $ egrep '[0-9]$' distfiles.txt | sed 's|.* \([0-9]*\)$|\1|' | awk '{ > sum += $1 / 10 } END { print sum "G" }' > 54.8126G > > Most of space is taken by distfiles which are at least 100 MB big: > > $ egrep '[0-9]{9}$' distfiles.txt | sed 's|.*

Re: Fun play with egrep, sed and awk

2019-12-26 Thread Andreas Kusalananda Kähäri
I was lucky with HTML layout which allowed me to go > straightforward: > > $ egrep '[0-9]$' distfiles.txt | sed 's|.* \([0-9]*\)$|\1|' | awk '{ > sum += $1 / 10 } END { print sum "G" }' > 54.8126G > > Most of space is taken by distfiles which are at least 100

Re: Fun play with egrep, sed and awk

2019-12-26 Thread Stefan Sperling
On Thu, Dec 26, 2019 at 04:13:33PM +, goleo . wrote: > Most of them are games, but what is Linux 4.20 kernel doing here? sysutils/dtb

Re: Fun play with egrep, sed and awk

2019-12-26 Thread Sebastien Marie
I was lucky with HTML layout which allowed me to go > straightforward: > > $ egrep '[0-9]$' distfiles.txt | sed 's|.* \([0-9]*\)$|\1|' | awk '{ > sum += $1 / 10 } END { print sum "G" }' > 54.8126G > > Most of space is taken by distfiles which are at least 100

Fun play with egrep, sed and awk

2019-12-26 Thread goleo .
grep '[0-9]$' distfiles.txt | sed 's|.* \([0-9]*\)$|\1|' | awk '{ sum += $1 / 10 } END { print sum "G" }' 54.8126G Most of space is taken by distfiles which are at least 100 MB big: $ egrep '[0-9]{9}$' distfiles.txt | sed 's|.* \([0-9]*\)$|\1|' | awk '{ sum += $1 / 10

Re: awk in OpenBSD

2017-10-18 Thread Adam Steen
to eliminate -0 results in T.expr, which has irritated me for 20+ years. [1] https://github.com/danfuzz/one-true-awk/blob/master/versions/2012-12-20/FIXES On Thu, Oct 19, 2017 at 1:14 PM, Niels Kobschaetzki <ni...@kobschaetzki.net> wrote: > >> On 19. Oct 2017, at 06:23, flipchan <f

Re: awk in OpenBSD

2017-10-18 Thread Theo de Raadt
i'm watching a bunch of losers who argue before running diff > You didn't really make a great case for the newer awk, either. Is there a > good reason to use the 2012 release from upstream? If so, you could submit > a diff and explain the benefits. > > On Oct 19, 2017 1

Re: awk in OpenBSD

2017-10-18 Thread Ax0n
You didn't really make a great case for the newer awk, either. Is there a good reason to use the 2012 release from upstream? If so, you could submit a diff and explain the benefits. On Oct 19, 2017 12:15 AM, "Niels Kobschaetzki" <ni...@kobschaetzki.net> wrote: > On 19.

Re: awk in OpenBSD

2017-10-18 Thread Niels Kobschaetzki
> On 19. Oct 2017, at 06:23, flipchan <flipc...@riseup.net> wrote: > > Yeah blindly follow the flow of the others , DONT THINK SO That doesn’t explain the reasoning WHY the newer awk is not used. >> On October 19, 2017 4:25:09 AM GMT+02:00, Andras Farkas >> <de

Re: awk in OpenBSD

2017-10-18 Thread flipchan
from outside >suppliers: >Awk Aug 10, 2011 version >This turns out to be one release behind upstream, where the latest >release is from December 20 2012: a quick check shows that >DragonFlyBSD, FreeBSD, and NetBSD all use this version. > >Just out of curiosity, is there a reason w

awk in OpenBSD

2017-10-18 Thread Andras Farkas
On the 6.2 release page, and confirmed in the source code, one can see The system includes the following major components from outside suppliers: Awk Aug 10, 2011 version This turns out to be one release behind upstream, where the latest release is from December 20 2012: a quick check shows

Re: Flex / Regexps (Re: awk regex bug)

2015-06-08 Thread hruodr
I wrote: [...] Why should be difficult to track the indices in yytext of the beginning and the end of each matching subexpression, in two arrays of integers (one for the beginning and one for the end)? [...] More exactly: in the first array the index of the first element of the matching

Flex / Regexps (Re: awk regex bug)

2015-06-08 Thread hruodr
Otto Moerbeek o...@drijf.net wrote: Refering to subpatterns is not available in flex. I suppose it is not available since it would require a more complex re engine. Interpretation of the lexical value should be hand-crafted. I also though caomplexity can be the reason, but I have doubts.

Re: awk regex bug

2015-06-08 Thread Otto Moerbeek
On Mon, Jun 08, 2015 at 02:49:44PM +, hru...@gmail.com wrote: Otto Moerbeek o...@drijf.net wrote: Tradiotionally, { } pattersn are not part of awk re's. Posix added them, but we do not include them afaik. Gnu awk only accepts them if given an extra arg (--posix or --re-interval

Re: awk regex bug

2015-06-08 Thread hruodr
Otto Moerbeek o...@drijf.net wrote: Tradiotionally, { } pattersn are not part of awk re's. Posix added them, but we do not include them afaik. Gnu awk only accepts them if given an extra arg (--posix or --re-interval). I think this should be documented. Although there is a clear theory

Re: awk regex bug

2015-05-28 Thread Otto Moerbeek
On Thu, May 28, 2015 at 02:08:47AM -0500, cwl...@mst.edu wrote: Hi misc, I'm running a 5.7 release, and I'm wondering if anyone can confirm an awk bug I found. Curly brackets are treated as literal characters instead of bounds as specified by re_format(7). Reproduction: echo aa

awk regex bug

2015-05-28 Thread cwlmb3
Hi misc, I'm running a 5.7 release, and I'm wondering if anyone can confirm an awk bug I found. Curly brackets are treated as literal characters instead of bounds as specified by re_format(7). Reproduction: echo aa | awk '/a{2}/' produces no output instead of printing aa as expected. echo

awk vs. mawk - printing zero bytes

2014-11-30 Thread Jan Stary
Here is a simple sine wave generator in awk. It produces 1 second of a 1000 Hz sine wave scaled to an amplitude of 24 bits, at 44100Hz. The individual 24bit samples are printed out as three bytes, from lowest to highest. $ cat sin.awk BEGIN { tone = 1000; duration = 1

Re: awk

2009-01-17 Thread Denny White
On Thu, Jan 15, 2009 at 02:41:24PM +, Andreas Kahari spoke thusly: 2009/1/15 igor denisov denisovigor1...@rambler.ru: Hi there Can not understand. input: 34523 9348 98493 82983 9485 83928 9283 9283 394 39934 293 8347 3456 9238 9283 9283 awk 'NR==1 { for (i = 1; i = NF; i

Re: awk

2009-01-17 Thread Denny White
394 39934 293 8347 3456 9238 9283 9283 awk 'NR==1 { for (i = 1; i = NF; i++) {n=$i; next}}; {n-=$i} END {print n}' input output: 21188 it is first column, why? You should really take these questions to an awk forum, not to this mailing list. Your program reads

looks like bug in awk

2009-01-15 Thread igor denisov
Hello there. There is a problem here. input: 34523 9485 394 3456 awk '{subtruct-=$1} END {print subtruct}' input output: -47858 same thing but without minus with awk '{sum+=$1} END {print sum}' input output: 47858 Why in both cases the code sums the field? -- igor denisov.

Re: looks like bug in awk

2009-01-15 Thread Andreas Kahari
2009/1/15 igor denisov denisovigor1...@rambler.ru: Hello there. There is a problem here. input: 34523 9485 394 3456 awk '{subtruct-=$1} END {print subtruct}' input output: -47858 same thing but without minus with awk '{sum+=$1} END {print sum}' input output: 47858 Why

Re: awk

2009-01-15 Thread Andreas Kahari
2009/1/15 igor denisov denisovigor1...@rambler.ru: Hi there Can not understand. input: 34523 9348 98493 82983 9485 83928 9283 9283 394 39934 293 8347 3456 9238 9283 9283 awk 'NR==1 { for (i = 1; i = NF; i++) {n=$i; next}}; {n-=$i} END {print n}' input output: 21188 it is first column

Re: looks like bug in awk

2009-01-15 Thread Danix
. input: 34523 9485 394 3456 awk '{subtruct-=$1} END {print subtruct}' input output: -47858 same thing but without minus with awk '{sum+=$1} END {print sum}' input output: 47858 Why in both cases the code sums the field? -- igor denisov.

awk doesn't recognize all of EREs

2008-09-04 Thread Vadim Zhukov
Our awk do not recognize range regex operator ({n,m} syntax). But man page says: awk supports extended regular expressions (EREs). See re_format(7) for more information on regular expressions. This behavior is same as in FreeBSD. gawk recognize range operator in POSIX mode (--posix). As far

Re: awk doesn't recognize all of EREs

2008-09-04 Thread Jason McIntyre
On Thu, Sep 04, 2008 at 12:35:20PM +0400, Vadim Zhukov wrote: Our awk do not recognize range regex operator ({n,m} syntax). But man page says: awk supports extended regular expressions (EREs). See re_format(7) for more information on regular expressions. This behavior is same

on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Hello. Just a though... I was writing a simple awk(1) script and looked at the options supported by this utility in the hope to make the code cleaner. It seems that there is a big difference between the synopsis in the manual page: awk [-safe] [-V] [-d[n]] [-F fs] [-v var=value] [prog | -f

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 07:37:04PM +0100, Igor Sobrado wrote: As a second change, I would suggest changing the usage message in the binary to fit on a standard 80 columns display. In short, I propose: - synchronizing the usage message returned by awk(1) and the synopsis

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Looking carefully at the switch () {...} structure in main.c it seems that the option -f requires an argument: iff the argument to -f is optional I would write: awk [-sae] [-V] [-d[n]] [-F fs] [-v var=value] [prog | -f [progfile]] file ... But it does not look as an optional argument

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Jason, you are very fast! I will download the new main.c as soon as I arrive at home and remove the case for the -m option. I will remove the f option in [-safe] as it seems that the argument to it is not optional. I will submit the patch, based on the updated code, later. Two changes: -

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 09:11:26PM +0100, Igor Sobrado wrote: Looking carefully at the switch () {...} structure in main.c it seems that the option -f requires an argument: iff the argument to -f is optional I would write: awk [-sae] [-V] [-d[n]] [-F fs] [-v var=value] [prog | -f [progfile

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
, that is now managed by the default case: # awk -mr awk: unknown option -mr ignored awk: no program given The second one fixes the man page for awk.1: --- awk.1 Mon Jan 29 15:01:15 2007 +++ awk.1 Mon Jan 29 15:01:30 2007 @@ -31,7 +31,7 @@ .Nd pattern-directed

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
without argument -s, -a, -f, -e in both main.c and the manual page for awk(1). Hope you will like this change too. Feel free to change the patch if you do not like it; I believe that removing the f option on -safe is good, but I can be wrong. Best wishes, Igor.

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
| -f [progfile]] but I believe that it is not optional, but required. In any case, the f option in -safe seems superfluous. The patches submitted remove the f option in the block of options without argument -s, -a, -f, -e in both main.c and the manual page for awk(1). Hope you will like

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
: # awk -mr awk: unknown option -mr ignored awk: no program given hmm, i don;t see the harm of flagging these as obsoleted...the output is very similar whatever way you do it, and at least this way people used to the old behaviour get a little more warning. additionally

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
In a private email, Philip Guenther has observed that awk does not completely folow the POSIX option guidelines. [-safe] is not [-s,-a,-f,-e] but a single option! The right patch is then: --- main.c.orig Mon Jan 29 15:01:20 2007 +++ main.c Mon Jan 29 15:52:47 2007 @@ -64,7 +64,7

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
On Mon, Jan 29, 2007, Jason McIntyre wrote: ah, ok. it is not 4 options (-s, -a, -f, and -e), but one (-safe, as in not in danger). that's why it is described as a ...first (and not very reliable) approximation to a ``safe'' version of awk. you are confusing that with the -f option, which

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 11:19:11PM +0100, Igor Sobrado wrote: I can send the patches to Brian Kernighan, asking him to apply these changes to the awk(1) source code. Do you agree? If you prefer sending the patches yourself, let me know. the changes will be sent upstream next time we