9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plan9port awk problem
@ 2010-04-19 15:29 Rudolf Sykora
  2010-04-19 16:31 ` erik quanstrom
  0 siblings, 1 reply; 11+ messages in thread
From: Rudolf Sykora @ 2010-04-19 15:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello,

My p9p awk, besides not having a manpage, also has a problem (plan9
version itself works fine, though):

;9 awk 'BEGIN {OFMT="%.0f"; print 17.23}'
17.23
;awk 'BEGIN {OFMT="%.0f"; print 17.23}'
17

Is p9p awk different from plan9's?!

Thanks
Ruda



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 15:29 [9fans] plan9port awk problem Rudolf Sykora
@ 2010-04-19 16:31 ` erik quanstrom
  2010-04-19 16:38   ` Rudolf Sykora
  2010-04-19 17:06   ` EBo
  0 siblings, 2 replies; 11+ messages in thread
From: erik quanstrom @ 2010-04-19 16:31 UTC (permalink / raw)
  To: 9fans

On Mon Apr 19 11:38:47 EDT 2010, rudolf.sykora@gmail.com wrote:
> Hello,
>
> My p9p awk, besides not having a manpage, also has a problem (plan9
> version itself works fine, though):
>
> ;9 awk 'BEGIN {OFMT="%.0f"; print 17.23}'
> 17.23
> ;awk 'BEGIN {OFMT="%.0f"; print 17.23}'
> 17
>
> Is p9p awk different from plan9's?!

this is a bug that bwk fixed.  it is fixed in the
new port of awk to plan 9, but not in the distribution
the new port is contrib quanstro/awk.

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 16:31 ` erik quanstrom
@ 2010-04-19 16:38   ` Rudolf Sykora
  2010-04-19 16:45     ` erik quanstrom
  2010-04-19 17:06   ` EBo
  1 sibling, 1 reply; 11+ messages in thread
From: Rudolf Sykora @ 2010-04-19 16:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> this is a bug that bwk fixed.  it is fixed in the
> new port of awk to plan 9, but not in the distribution
> the new port is contrib quanstro/awk.
>
> - erik


I don't get it.
As I said, awk in plan9 works ok in the mentioned respect.
I said that plan9port awk gets it wrong for some reason...

R



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 16:38   ` Rudolf Sykora
@ 2010-04-19 16:45     ` erik quanstrom
  2010-04-19 16:50       ` Rudolf Sykora
  0 siblings, 1 reply; 11+ messages in thread
From: erik quanstrom @ 2010-04-19 16:45 UTC (permalink / raw)
  To: 9fans

> I don't get it.
> As I said, awk in plan9 works ok in the mentioned respect.
> I said that plan9port awk gets it wrong for some reason...
>
> R

i just ran awk from sources.  it produces the same
output as you produced for p9p awk.  if you say
that p9p awk is wrong, then plan 9 awk is wrong
too since it produces the same output.

here's what you had:

	;9 awk 'BEGIN {OFMT="%.0f"; print 17.23}'
	17.23
	;awk 'BEGIN {OFMT="%.0f"; print 17.23}'
	17

and here's what the awk as distributed on sources does
	minooka; /n/sources/plan9/386/bin/awk 'BEGIN {OFMT="%.0f"; print 17.23}'
	17.23

yet here's what the awk done with bwk's current sources does
	minooka; awk 'BEGIN {OFMT="%.0f"; print 17.23}'
	17

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 16:45     ` erik quanstrom
@ 2010-04-19 16:50       ` Rudolf Sykora
  2010-04-19 16:53         ` Rudolf Sykora
  0 siblings, 1 reply; 11+ messages in thread
From: Rudolf Sykora @ 2010-04-19 16:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 19 April 2010 18:45, erik quanstrom <quanstro@quanstro.net> wrote:
>> I don't get it.
>> As I said, awk in plan9 works ok in the mentioned respect.
>> I said that plan9port awk gets it wrong for some reason...
>>
>> R
>
> i just ran awk from sources.  it produces the same
> output as you produced for p9p awk.  if you say
> that p9p awk is wrong, then plan 9 awk is wrong
> too since it produces the same output.
>
> here's what you had:
>
>        ;9 awk 'BEGIN {OFMT="%.0f"; print 17.23}'
>        17.23
>        ;awk 'BEGIN {OFMT="%.0f"; print 17.23}'
>        17
>
> and here's what the awk as distributed on sources does
>        minooka; /n/sources/plan9/386/bin/awk 'BEGIN {OFMT="%.0f"; print 17.23}'
>        17.23
>
> yet here's what the awk done with bwk's current sources does
>        minooka; awk 'BEGIN {OFMT="%.0f"; print 17.23}'
>        17
>
> - erik
>
>
Then something strange must have happened recently...
Or something like that.
I had checked and now did it again, on my plan 9 computer, that I get 17.
R



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 16:50       ` Rudolf Sykora
@ 2010-04-19 16:53         ` Rudolf Sykora
  2010-04-19 17:03           ` erik quanstrom
  0 siblings, 1 reply; 11+ messages in thread
From: Rudolf Sykora @ 2010-04-19 16:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Then something strange must have happened recently...
> Or something like that.
> I had checked and now did it again, on my plan 9 computer, that I get 17.
> R
>
ls -l /bin/awk
says it's from Dec 1 20:23, 334087 bytes.
R



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 16:53         ` Rudolf Sykora
@ 2010-04-19 17:03           ` erik quanstrom
  2010-04-19 17:19             ` Rudolf Sykora
  0 siblings, 1 reply; 11+ messages in thread
From: erik quanstrom @ 2010-04-19 17:03 UTC (permalink / raw)
  To: 9fans

On Mon Apr 19 12:54:16 EDT 2010, rudolf.sykora@gmail.com wrote:
> > Then something strange must have happened recently...
> > Or something like that.
> > I had checked and now did it again, on my plan 9 computer, that I get 17.
> > R
> >
> ls -l /bin/awk
> says it's from Dec 1 20:23, 334087 bytes.
> R

it appears that you installed my contrib verison of awk:
(or used 9atom)

; ls -l /n/sources/contrib/quanstro/root/386/bin/awk
--rwxrwxr-x M 450 quanstro sys 334087 Dec  1 14:23 /n/sources/contrib/quanstro/root/386/bin/awk

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 16:31 ` erik quanstrom
  2010-04-19 16:38   ` Rudolf Sykora
@ 2010-04-19 17:06   ` EBo
  1 sibling, 0 replies; 11+ messages in thread
From: EBo @ 2010-04-19 17:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs, erik quanstrom


> this is a bug that bwk fixed.  it is fixed in the
> new port of awk to plan 9, but not in the distribution
> the new port is contrib quanstro/awk.

sorry, I'm confused here.  Does that mean that we should use contrib
quanstro/awk? Or not?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 17:03           ` erik quanstrom
@ 2010-04-19 17:19             ` Rudolf Sykora
  2010-04-19 17:31               ` Vivien MOREAU
  2010-04-19 17:37               ` erik quanstrom
  0 siblings, 2 replies; 11+ messages in thread
From: Rudolf Sykora @ 2010-04-19 17:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> it appears that you installed my contrib verison of awk:
> (or used 9atom)
>
> ; ls -l /n/sources/contrib/quanstro/root/386/bin/awk
> --rwxrwxr-x M 450 quanstro sys 334087 Dec  1 14:23 /n/sources/contrib/quanstro/root/386/bin/awk
>
> - erik
>

Yes, that's it. 9atom is what I used... :)

So, now I join those people asking: what's the difference between
9atom awk, current sources awk, bwk, what else? Why are there so many
of them?

Thanks
Ruda



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 17:19             ` Rudolf Sykora
@ 2010-04-19 17:31               ` Vivien MOREAU
  2010-04-19 17:37               ` erik quanstrom
  1 sibling, 0 replies; 11+ messages in thread
From: Vivien MOREAU @ 2010-04-19 17:31 UTC (permalink / raw)
  To: 9fans

Monday 19 Apr 2010 � 19:19:14 (+0200), Rudolf Sykora wrote :

> So, now I join those people asking: what's the difference between
> 9atom awk, current sources awk, bwk, what else? Why are there so many
> of them?

bwk is not an awk implementation.
<http://www.cs.princeton.edu/~bwk/>

	:-)

--
Vivien MOREAU




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] plan9port awk problem
  2010-04-19 17:19             ` Rudolf Sykora
  2010-04-19 17:31               ` Vivien MOREAU
@ 2010-04-19 17:37               ` erik quanstrom
  1 sibling, 0 replies; 11+ messages in thread
From: erik quanstrom @ 2010-04-19 17:37 UTC (permalink / raw)
  To: 9fans

On Mon Apr 19 13:20:13 EDT 2010, rudolf.sykora@gmail.com wrote:
> > it appears that you installed my contrib verison of awk:
> > (or used 9atom)
> >
> > ; ls -l /n/sources/contrib/quanstro/root/386/bin/awk
> > --rwxrwxr-x M 450 quanstro sys 334087 Dec  1 14:23 /n/sources/contrib/quanstro/root/386/bin/awk
> >
> > - erik
> >
>
> Yes, that's it. 9atom is what I used... :)
>
> So, now I join those people asking: what's the difference between
> 9atom awk, current sources awk, bwk, what else? Why are there so many
> of them?

there are two versions.

there's the official sources version.  it's based on bwk's source
from about 2000 or so.  this is what's used in p9p.

there's also the newer port (using the same framework).
it's based on bwk's latest version as of 20091101.  in addition,
i added some code to correct a floating point overflow bug
that was most noticable in using %x and %o formats.
(this bug was also present in gawk and every other version
of awk tested.  details were posted to the list.)

this version of awk is in 9atom and in contrib quanstro/awk.
feel free to diff away.  the differences are a bit greater than
they should be since erstwhile ken c changes made it easier
to avoid suprious edits to bwk's code.  diffs against bwk's code
should also be instructive.

so there are exactly two differences between the two versions
1) bwk's bug fixes
2) fix for implicit fpes.

- erik



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-19 17:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 15:29 [9fans] plan9port awk problem Rudolf Sykora
2010-04-19 16:31 ` erik quanstrom
2010-04-19 16:38   ` Rudolf Sykora
2010-04-19 16:45     ` erik quanstrom
2010-04-19 16:50       ` Rudolf Sykora
2010-04-19 16:53         ` Rudolf Sykora
2010-04-19 17:03           ` erik quanstrom
2010-04-19 17:19             ` Rudolf Sykora
2010-04-19 17:31               ` Vivien MOREAU
2010-04-19 17:37               ` erik quanstrom
2010-04-19 17:06   ` EBo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).