Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Parkinson's Law: Work expands to fill the time alloted it.


devel / comp.lang.awk / Re: The Book - "The AWK Programming Language"

SubjectAuthor
* writing a good gsub regexp for matching between two specific charactersBryan
`* Re: writing a good gsub regexp for matching between two specificJanis Papanagnou
 `* Re: writing a good gsub regexp for matching between two specific charactersBryan
  `* Re: writing a good gsub regexp for matching between two specific charactersKenny McCormack
   `* Re: writing a good gsub regexp for matching between two specific charactersBryan
    +- Re: writing a good gsub regexp for matching between two specific charactersBryan
    `* Re: writing a good gsub regexp for matching between two specificJanis Papanagnou
     `* Re: writing a good gsub regexp for matching between two specificJanis Papanagnou
      `* Re: writing a good gsub regexp for matching between two specific charactersBryan
       +* Re: writing a good gsub regexp for matching between two specificJanis Papanagnou
       |`* Re: writing a good gsub regexp for matching between two specific charactersBen Bacarisse
       | `* Re: writing a good gsub regexp for matching between two specificJanis Papanagnou
       |  `* Re: writing a good gsub regexp for matching between two specific charactersBryan
       |   `- Re: writing a good gsub regexp for matching between two specificEd Morton
       `* Re: writing a good gsub regexp for matching between two specific charactersKeith Thompson
        `* Re: writing a good gsub regexp for matching between two specific charactersKpop 2GM
         +* The Book - "The AWK Programming Language"Janis Papanagnou
         |`* Re: The Book - "The AWK Programming Language"jeorge
         | `* Re: The Book - "The AWK Programming Language"Janis Papanagnou
         |  `* Re: The Book - "The AWK Programming Language"Keith Thompson
         |   `- Re: The Book - "The AWK Programming Language"Janis Papanagnou
         `- Re: writing a good gsub regexp for matching between two specific charactersKeith Thompson

1
writing a good gsub regexp for matching between two specific characters

<0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1386&group=comp.lang.awk#1386

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:5305:b0:742:7e5a:4cee with SMTP id oo5-20020a05620a530500b007427e5a4ceemr2010919qkn.10.1678579570547;
Sat, 11 Mar 2023 16:06:10 -0800 (PST)
X-Received: by 2002:a05:6870:a881:b0:169:cbd0:1a1 with SMTP id
eb1-20020a056870a88100b00169cbd001a1mr10505745oab.0.1678579570229; Sat, 11
Mar 2023 16:06:10 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sat, 11 Mar 2023 16:06:09 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=2601:190:67f:67bb:80c2:9549:4ceb:1c9b;
posting-account=PtxH9gkAAAAGMw6wJDvB_vinyKd1zCKS
NNTP-Posting-Host: 2601:190:67f:67bb:80c2:9549:4ceb:1c9b
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
Subject: writing a good gsub regexp for matching between two specific characters
From: bryanlepore@gmail.com (Bryan)
Injection-Date: Sun, 12 Mar 2023 00:06:10 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3649
 by: Bryan - Sun, 12 Mar 2023 00:06 UTC

I'm using gawk 5.1.0, bash 5.1.16, Ubuntu 22.04.2. I will write and provide a lot of material in case it is useful or there is conflict in the script, but I am trying not to ramble.

I prepared a test script below - which should be easy to copy/paste into a shell, e.g. bash. I am focused on the gsub regexps, which are obviously contrived to replace all these different strings which - as they vary from output from another program - take the general form (attempting a "plain English" version):

[open apostrophe][the word "path"][maybe an underscore][various digits][end apostrophe]

I want to take all of that ^^^ and delete it - or equivalently replace it with nothing (ideally), to prepare input to gnuplot as "x,y" or "x y" data - two columns.

I tried using this type of command :

gsub("^[a-z]{4}$","TEST") ;

.... and more, e.g. trying sub and gensub - but did not get far - I am aware of a curly brace escape that is important or not depending on the awk version, so I also tried with \{ and \}.

I put "TEST" in the present case for testing a few different cases. I wrote this script based on extensive reading of a certain popular online resource and the The Awk Programming Language (1988 - maybe time for a newer edition?). This is a useful script because as I find new types of output from the upstream program (a whole other story), I might add new gsub commands to take care of it.

copy/paste example script:

echo "\
{\"path_1234567\"\
:[`seq -s',' -f '%f' 1 20 `],\
\"path_123456\"\
:[`seq -s',' -f '%f' 1 20 `],\
\"path_1234\"\
:[`seq -s',' -f '%f' 1 20 `],\
\"path1234\"\
:[`seq -s',' -f '%f' 1 20 `]}" | \
gawk -F, '
{ gsub("\{","") ;
gsub("\}","") ;
gsub("\]","") ;
gsub("^[a-z]{4}$","TEST") ;
gsub("\"[a-z][a-z][a-z][a-z]_[0-9][0-9][0-9][0-9][0-9][0-9][0-9]\":\\\[","TESTSEVEN") ;
gsub("\"[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9][0-9][0-9]\":\\\[","TESTSIX") ;
gsub("\"[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9]\":\\\[","TESTFOURB") ;
gsub("\"[a-z][a-z][a-z][a-z]_[0-9][0-9][0-9][0-9]\":\\\[","TESTFOURA") ;
for (i=1;i<=NF;i++)
{
printf("%s%s",$i,i%2?",":"\n")
}
}'

.... the last printf thing is perhaps for another post, but (IIUC) matches every 2nd comma and replaces it with a newline. So that's the "x,y" data idea. I hope that is clear - I imagine the regexps in the [a-z][0-9] parts ought to be able to go all into one gsub if I knew the syntax or what to read about.

Re: writing a good gsub regexp for matching between two specific characters

<tujepc$2so2r$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1388&group=comp.lang.awk#1388

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific
characters
Date: Sun, 12 Mar 2023 03:52:27 +0100
Organization: A noiseless patient Spider
Lines: 137
Message-ID: <tujepc$2so2r$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 12 Mar 2023 02:52:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="13c88a5940ddb2e905252e4bb775beeb";
logging-data="3039323"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9HpY+1g5HotraFNhPsucP"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:NyhniT3RZk28o46nm05wiaWZV3U=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
 by: Janis Papanagnou - Sun, 12 Mar 2023 02:52 UTC

First, I cannot really decipher what you actually want to do and
where your problems are. The usual procedure is to post sample data:
input data and the corresponding output data at least (not shell
code that creates the input data). Anyway you find below some hints
and suggestions...

On 12.03.2023 01:06, Bryan wrote:
> I'm using gawk 5.1.0, bash 5.1.16, Ubuntu 22.04.2. I will write and
> provide a lot of material in case it is useful or there is conflict
> in the script, but I am trying not to ramble.
>
> I prepared a test script below - which should be easy to copy/paste
> into a shell, e.g. bash. I am focused on the gsub regexps, which are
> obviously contrived to replace all these different strings which - as
> they vary from output from another program - take the general form
> (attempting a "plain English" version):
>
> [open apostrophe][the word "path"][maybe an underscore][various
> digits][end apostrophe]
>
> I want to take all of that ^^^ and delete it - or equivalently
> replace it with nothing (ideally), to prepare input to gnuplot as
> "x,y" or "x y" data - two columns.
>
> I tried using this type of command :
>
> gsub("^[a-z]{4}$","TEST") ;

This is fine to substitutes lines containing _only_ a sequence of
four lower case letters to "TEST". gsub() _without_ the ^ and $
anchors will substitute any occurrence of that pattern on a line.
You can provide a third argument to gsub() to operate on variables
or specific fields; in that case the anchors ^ and $ will define
the beginning and end of that variable or field respectively.
It is also advantageous to use /.../ syntax for constant patterns
instead of the string form "...".

>
> ... and more, e.g. trying sub and gensub - but did not get far - I am
> aware of a curly brace escape that is important or not depending on
> the awk version, so I also tried with \{ and \}.

There's no need to escape these braces.

>
> I put "TEST" in the present case for testing a few different cases. I
> wrote this script based on extensive reading of a certain popular
> online resource and the The Awk Programming Language (1988 - maybe
> time for a newer edition?). This is a useful script because as I find
> new types of output from the upstream program (a whole other story),
> I might add new gsub commands to take care of it.
>
> copy/paste example script:
> echo "\
> {\"path_1234567\"\
> :[`seq -s',' -f '%f' 1 20 `],\
> \"path_123456\"\
> :[`seq -s',' -f '%f' 1 20 `],\
> \"path_1234\"\
> :[`seq -s',' -f '%f' 1 20 `],\
> \"path1234\"\
> :[`seq -s',' -f '%f' 1 20 `]}" | \
> gawk -F, '
> {
> gsub("\{","") ;
> gsub("\}","") ;
> gsub("\]","") ;
> gsub("^[a-z]{4}$","TEST") ;
> gsub("\"[a-z][a-z][a-z][a-z]_[0-9][0-9][0-9][0-9][0-9][0-9][0-9]\":\\\[","TESTSEVEN") ;
> gsub("\"[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9][0-9][0-9]\":\\\[","TESTSIX") ;
> gsub("\"[a-z][a-z][a-z][a-z][0-9][0-9][0-9][0-9]\":\\\[","TESTFOURB") ;
> gsub("\"[a-z][a-z][a-z][a-z]_[0-9][0-9][0-9][0-9]\":\\\[","TESTFOURA") ;
> for (i=1;i<=NF;i++)
> {
> printf("%s%s",$i,i%2?",":"\n")
> }
> }'

Instead of echo arguments with quotes and newline-escapes I suggest,
in shell, to use here-documents with this syntax:

awk '
# ... your awk program ...
...
' <<EOT
your data line 1
your data line 2
...
EOT

and with the more contemporary $(...) a line might be

{"path_1234567":[$(seq -s',' -f '%f' 1 20)], ...

but I wouldn't call seq many times but only once and assign it to a
variable and use that repeatedly

s=$(seq -s',' -f '%f' 1 20)
awk '
...
' <<EOT
{"path_1234567":[${s}], ...
...
EOT

If you pipe in or redirect other input just omit the code from <<EOT
onward.
data_from_some_process | awk '...'
awk '...' < data_from_some_file

(But for testing the here-documents have advantages.)

>
> ... the last printf thing is perhaps for another post, but (IIUC)
> matches every 2nd comma and replaces it with a newline.

printf doesn't replace anything. It prints every other time a newline
instead of a comma.

> So that's the
> "x,y" data idea. I hope that is clear - I imagine the regexps in the
> [a-z][0-9] parts ought to be able to go all into one gsub if I knew
> the syntax or what to read about.

To match more than one regexp for the _same_ replacement you can
combine them with the | (or) operator. For an example from your
code above use, e.g., gsub(/{|}|]/, "") to remove those three
braces/brackets in one expression.

But with your samples above you can also use other regexp syntaxes,
like ? (for optional parts) and use grouping with parenthesis (...)
for longer subexpressions, e.g.
[a-z][4}_?[0-9]{4}([0-9]{2})?
for an optional underscore and two optional digits.

Janis

Re: writing a good gsub regexp for matching between two specific characters

<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1389&group=comp.lang.awk#1389

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ac8:4101:0:b0:3b8:6767:eb15 with SMTP id q1-20020ac84101000000b003b86767eb15mr8060432qtl.1.1678638350796;
Sun, 12 Mar 2023 09:25:50 -0700 (PDT)
X-Received: by 2002:a54:4810:0:b0:384:4e2d:81ea with SMTP id
j16-20020a544810000000b003844e2d81eamr10521604oij.9.1678638350581; Sun, 12
Mar 2023 09:25:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sun, 12 Mar 2023 09:25:50 -0700 (PDT)
In-Reply-To: <tujepc$2so2r$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:190:67f:67bb:80c2:9549:4ceb:1c9b;
posting-account=PtxH9gkAAAAGMw6wJDvB_vinyKd1zCKS
NNTP-Posting-Host: 2601:190:67f:67bb:80c2:9549:4ceb:1c9b
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com> <tujepc$2so2r$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
Subject: Re: writing a good gsub regexp for matching between two specific characters
From: bryanlepore@gmail.com (Bryan)
Injection-Date: Sun, 12 Mar 2023 16:25:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1833
 by: Bryan - Sun, 12 Mar 2023 16:25 UTC

Apologies for the `seq` synthetic data, I'll prepare it the better way next time.

> But with your samples above you can also use other regexp syntaxes,
> like ? (for optional parts) and use grouping with parenthesis (...)
> for longer subexpressions, e.g.
> [a-z][4}_?[0-9]{4}([0-9]{2})?
> for an optional underscore and two optional digits.

This is exactly what I was looking for and it works (I think a typo is in there but let's leave it for now).

I tried {1-4} to get a range, but it didn't work - is that the idea? so

[a-z]{4}_?[0-9]{4}([0-9]{1-4})?

to match any number of digits from 1 to 4?

Re: writing a good gsub regexp for matching between two specific characters

<tukvr6$107tu$1@news.xmission.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1390&group=comp.lang.awk#1390

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific characters
Date: Sun, 12 Mar 2023 16:49:42 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <tukvr6$107tu$1@news.xmission.com>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com> <tujepc$2so2r$1@dont-email.me> <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
Injection-Date: Sun, 12 Mar 2023 16:49:42 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1056702"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Sun, 12 Mar 2023 16:49 UTC

In article <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>,
Bryan <bryanlepore@gmail.com> wrote:
>Apologies for the `seq` synthetic data, I'll prepare it the better way
>next time.
>
>> But with your samples above you can also use other regexp syntaxes,
>> like ? (for optional parts) and use grouping with parenthesis (...)
>> for longer subexpressions, e.g.
>> [a-z][4}_?[0-9]{4}([0-9]{2})?
>> for an optional underscore and two optional digits.
>
>This is exactly what I was looking for and it works (I think a typo is
>in there but let's leave it for now).
>
>I tried {1-4} to get a range, but it didn't work - is that the idea? so
>
>[a-z]{4}_?[0-9]{4}([0-9]{1-4})?
>
>to match any number of digits from 1 to 4?

It is: {1,4}

--
"If our country is going broke, let it be from feeding the poor and caring for
the elderly. And not from pampering the rich and fighting wars for them."

--Living Blue in a Red State--

Re: writing a good gsub regexp for matching between two specific characters

<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1391&group=comp.lang.awk#1391

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:620a:51c5:b0:742:3013:1aa0 with SMTP id cx5-20020a05620a51c500b0074230131aa0mr1926019qkb.3.1678651869596;
Sun, 12 Mar 2023 13:11:09 -0700 (PDT)
X-Received: by 2002:a4a:d384:0:b0:525:65a1:acd9 with SMTP id
i4-20020a4ad384000000b0052565a1acd9mr2964424oos.0.1678651869313; Sun, 12 Mar
2023 13:11:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sun, 12 Mar 2023 13:11:09 -0700 (PDT)
In-Reply-To: <tukvr6$107tu$1@news.xmission.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:190:67f:67bb:b33f:8c67:a450:6dc2;
posting-account=PtxH9gkAAAAGMw6wJDvB_vinyKd1zCKS
NNTP-Posting-Host: 2601:190:67f:67bb:b33f:8c67:a450:6dc2
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me> <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
Subject: Re: writing a good gsub regexp for matching between two specific characters
From: bryanlepore@gmail.com (Bryan)
Injection-Date: Sun, 12 Mar 2023 20:11:09 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1858
 by: Bryan - Sun, 12 Mar 2023 20:11 UTC

This is great. My old awk book (Aho, Kernighan, and Weinberger) has a table on p.32 saying :

"expression [c1-c2] matches any character in the range beginning with c1 and ending with c2."

.... p.30 has more discussion, and I never saw anything about the comma "," to indicate a range - perhaps this is a strong indication I need to get a better book.

And, I apologize, but I must say - this discussion reached a good answer in less than 24 hours - even though discussion doesn't "scale", and I can't cast a vote on it.

IOW Thank you!

Re: writing a good gsub regexp for matching between two specific characters

<d1414293-baef-4ee2-bb5a-ce687e215dc5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1392&group=comp.lang.awk#1392

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ac8:530d:0:b0:3bf:d025:1ac1 with SMTP id t13-20020ac8530d000000b003bfd0251ac1mr8190950qtn.11.1678653819289;
Sun, 12 Mar 2023 13:43:39 -0700 (PDT)
X-Received: by 2002:a05:6870:1010:b0:177:b992:fee7 with SMTP id
16-20020a056870101000b00177b992fee7mr181814oai.3.1678653818936; Sun, 12 Mar
2023 13:43:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Sun, 12 Mar 2023 13:43:38 -0700 (PDT)
In-Reply-To: <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:190:67f:67bb:b33f:8c67:a450:6dc2;
posting-account=PtxH9gkAAAAGMw6wJDvB_vinyKd1zCKS
NNTP-Posting-Host: 2601:190:67f:67bb:b33f:8c67:a450:6dc2
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me> <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com> <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d1414293-baef-4ee2-bb5a-ce687e215dc5n@googlegroups.com>
Subject: Re: writing a good gsub regexp for matching between two specific characters
From: bryanlepore@gmail.com (Bryan)
Injection-Date: Sun, 12 Mar 2023 20:43:39 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: Bryan - Sun, 12 Mar 2023 20:43 UTC

addendum : in writing a separate question about the printf statement, I found a better way to print a newline instead of every 2nd comma from a long string of signed floating points, so I simply share the method here :

digits=$(seq -s',' -f '%f' -10 10)
gawk -F, '
{ for (i=1;i<=NF;i++)
{
printf("%3.6f%s",$i,i%2?",":"\n")
}
}' <<EOT
${digits}
EOT

Re: writing a good gsub regexp for matching between two specific characters

<tulgvi$38dnd$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1393&group=comp.lang.awk#1393

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific
characters
Date: Sun, 12 Mar 2023 22:42:10 +0100
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <tulgvi$38dnd$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 12 Mar 2023 21:42:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="13c88a5940ddb2e905252e4bb775beeb";
logging-data="3421933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TQ3DBpgPtHGWf+q94upiS"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:dIckZi7qOJIKcDn8g7ZdCiFMUIs=
In-Reply-To: <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sun, 12 Mar 2023 21:42 UTC

On 12.03.2023 21:11, Bryan wrote:
> This is great. My old awk book (Aho, Kernighan, and Weinberger) has a
> table on p.32 saying :
>
> "expression [c1-c2] matches any character in the range beginning
> with c1 and ending with c2."

You are referring here to something different. Slightly simplified said
[a-z] is a regexp matching any single lowercase letter
[0-9] any single digit
[0-9a-fA-F] any hexadecimal digit

The multiplicity syntax {N}, {N,}, {,M}, {N,M} is not supported by the
classic awk ("nawk") that is based of Aho's, etc. book. More recent and
commonly used Awks like GNU awk supports it, though. That's why there's
no mention in that book.

>
> ... p.30 has more discussion, and I never saw anything about the
> comma "," to indicate a range - perhaps this is a strong indication I
> need to get a better book.

The old book is excellently written and contains all what comprises
the power of the awk language. (Don't ignore it nor throw it away!)

But I suggest, especially if you use GNU awk which supports yet more
features, to get a copy of Arnold Robbin's "Effective Awk Programming"
which is based on GNU Awk. (It's also online available in a searchable
digital form.)

Janis

Re: writing a good gsub regexp for matching between two specific characters

<tuo32v$3u6ta$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1394&group=comp.lang.awk#1394

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific
characters
Date: Mon, 13 Mar 2023 22:03:26 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <tuo32v$3u6ta$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 13 Mar 2023 21:03:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="10779ae6a5d7252dd9760a3936426a7b";
logging-data="4135850"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vS9OJMsJi2G0PstgwkoRk"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:JL45l5/9SsTCh0r817PRQnPkBck=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <tulgvi$38dnd$1@dont-email.me>
 by: Janis Papanagnou - Mon, 13 Mar 2023 21:03 UTC

On 12.03.2023 22:42, Janis Papanagnou wrote:
> On 12.03.2023 21:11, Bryan wrote:
>> This is great. My old awk book (Aho, Kernighan, and Weinberger) [...]
>
> The multiplicity syntax {N}, {N,}, {,M}, {N,M} is not supported by the
> classic awk ("nawk") that is based of Aho's, etc. book. More recent and
> commonly used Awks like GNU awk supports it, though. That's why there's
> no mention in that book.

While true for classic awk ("nawk") Arnold Robbins informed me that
in more recent versions of "nawk" this syntax is also supported, now
already for years. (Just in case my post was misinterpreted.)

To my knowledge, though, there's no newer/updated releases of the book
you mentioned; it is based on the old version of (n)awk, and thus it
does not describe that (newer) feature. (Which was my point.)

Janis

Re: writing a good gsub regexp for matching between two specific characters

<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1395&group=comp.lang.awk#1395

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:600c:1c83:b0:3e9:1b9a:92f2 with SMTP id k3-20020a05600c1c8300b003e91b9a92f2mr4265071wms.5.1678802157950;
Tue, 14 Mar 2023 06:55:57 -0700 (PDT)
X-Received: by 2002:a05:6870:98aa:b0:172:64e8:4009 with SMTP id
eg42-20020a05687098aa00b0017264e84009mr13352291oab.10.1678802157321; Tue, 14
Mar 2023 06:55:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Tue, 14 Mar 2023 06:55:57 -0700 (PDT)
In-Reply-To: <tuo32v$3u6ta$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:190:67f:67bb:6e66:b21c:6eaf:7e4e;
posting-account=PtxH9gkAAAAGMw6wJDvB_vinyKd1zCKS
NNTP-Posting-Host: 2601:190:67f:67bb:6e66:b21c:6eaf:7e4e
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me> <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com> <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
Subject: Re: writing a good gsub regexp for matching between two specific characters
From: bryanlepore@gmail.com (Bryan)
Injection-Date: Tue, 14 Mar 2023 13:55:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Bryan - Tue, 14 Mar 2023 13:55 UTC

I noticed in the "Computerphile" video with Brian Kernighan - shared on this user group - that a new version of The Awk Book might be in the works as of August 2022.

Meanwhile, the overnight delivery is in-hand now, and, from page 45:

"[begin quote]
{n}
{n,}
{n,m}
One or two numbers inside braces denote an *interval expression*. If there is one number in the braces, the preceeding regexp is repeated n times. If there are two numbers separated by a comma, the preceding regexp is repeated n to m times. if [p. 46] there is one number followed by a comma, then the preceding regexp is repeated at least n times:[end quote]"

.... examples shown are :
wh{3}y Matches 'whhhy', but not 'why' or 'whhhhy'.
wh{3,5}y matches 'whhhy', 'whhhy', or 'whhhhhy' only.
wh{2,}y matches 'whhy', 'whhhy', and so on.

There is more.

Lastly, fom the back cover :

"You have the freedom to copy and modify this GNU manual."

Glad to support the FSF in this way!

Re: writing a good gsub regexp for matching between two specific characters

<tuqv4m$i6t6$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1396&group=comp.lang.awk#1396

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific
characters
Date: Wed, 15 Mar 2023 00:14:30 +0100
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <tuqv4m$i6t6$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 14 Mar 2023 23:14:30 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="db3ccb994c9f0c1e9d2d9ce18cb550cc";
logging-data="596902"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CRFwZ9rcJaUAsFeKPbx72"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:UaeQxrcsZsgw0LEevg6aAFNHu94=
In-Reply-To: <8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Tue, 14 Mar 2023 23:14 UTC

On 14.03.2023 14:55, Bryan wrote:
> I noticed in the "Computerphile" video with Brian Kernighan - shared
> on this user group - that a new version of The Awk Book might be in
> the works as of August 2022.

I cannot find a new version of the original Awk book with Google
(or other commercial providers). Could you provide a link, please?

Or are you speaking about Arnold Robbin's book? (Especially since
below you mention GNU and the FSF.)

I'm certainly confused by your mention of Brian Kernighan, one of
the authors of the original book.

>
> Meanwhile, the overnight delivery is in-hand now, [...] There is
> more.
>
> Lastly, fom the back cover :
> "You have the freedom to copy and modify this GNU manual."
>
> Glad to support the FSF in this way!

Janis

Re: writing a good gsub regexp for matching between two specific characters

<87fsa699rj.fsf@bsb.me.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1397&group=comp.lang.awk#1397

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.lists@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific characters
Date: Tue, 14 Mar 2023 23:46:24 +0000
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <87fsa699rj.fsf@bsb.me.uk>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<tuqv4m$i6t6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="c5f074961d5b5cb9166f206f99bd0559";
logging-data="602912"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/2c0jIGhHD9YHxNB0n6KYg3bgW4th/Byk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:bPQKV3gYassMN5a5kL1EHPe98d0=
sha1:3FkA2arKrYhX5cLkYV0ZdFzzUbI=
X-BSB-Auth: 1.51118ce7580351eb42e3.20230314234624GMT.87fsa699rj.fsf@bsb.me.uk
 by: Ben Bacarisse - Tue, 14 Mar 2023 23:46 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

> On 14.03.2023 14:55, Bryan wrote:
>> I noticed in the "Computerphile" video with Brian Kernighan - shared
>> on this user group - that a new version of The Awk Book might be in
>> the works as of August 2022.
>
> I cannot find a new version of the original Awk book with Google
> (or other commercial providers). Could you provide a link, please?
>
> Or are you speaking about Arnold Robbin's book? (Especially since
> below you mention GNU and the FSF.)
>
> I'm certainly confused by your mention of Brian Kernighan, one of
> the authors of the original book.

Th phrase "might be in the works" means only that there is a possibility
that a new edition might be in preparation. Is that's what's confusing?

Bryan is clearly talking about a new version of the original book, but
he is referring to the most vague suggestion that there might, soon, be
a new edition. As far as I can tell there isn't one, but there could be
on "in the works" (i.e. in preparation).

--
Ben.

Re: writing a good gsub regexp for matching between two specific characters

<87zg8eopw3.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1398&group=comp.lang.awk#1398

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific characters
Date: Tue, 14 Mar 2023 16:49:00 -0700
Organization: None to speak of
Lines: 43
Message-ID: <87zg8eopw3.fsf@nosuchdomain.example.com>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="7c9d096ab58fbd6d2142330c24407bd5";
logging-data="607170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19i79dJjsLEFvrXpsr6FAjn"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:sQYjRT9lkY/m4N6MeWQXJtzlyTg=
sha1:yDaCqYqQ14JeuvftOZA9SA+8HwY=
 by: Keith Thompson - Tue, 14 Mar 2023 23:49 UTC

Bryan <bryanlepore@gmail.com> writes:
> I noticed in the "Computerphile" video with Brian Kernighan - shared
> on this user group - that a new version of The Awk Book might be in
> the works as of August 2022.
>
> Meanwhile, the overnight delivery is in-hand now, and, from page 45:
>
> "[begin quote]
> {n}
> {n,}
> {n,m}
> One or two numbers inside braces denote an *interval expression*. If
> there is one number in the braces, the preceeding regexp is repeated n
> times. If there are two numbers separated by a comma, the preceding
> regexp is repeated n to m times. if [p. 46] there is one number
> followed by a comma, then the preceding regexp is repeated at least n
> times:[end quote]"
>
> ... examples shown are :
> wh{3}y Matches 'whhhy', but not 'why' or 'whhhhy'.
> wh{3,5}y matches 'whhhy', 'whhhy', or 'whhhhhy' only.
> wh{2,}y matches 'whhy', 'whhhy', and so on.
>
> There is more.
>
> Lastly, fom the back cover :
>
> "You have the freedom to copy and modify this GNU manual."
>
> Glad to support the FSF in this way!

That's the GNU Awk manual. I don't have a printed version, but it
appears to have the same content as the online manual available by
typing "info gawk" (if you have the right things installed)
or at <https://www.gnu.org/software/gawk/manual/gawk.html>.

"The Awk Book" presumably refers to the original "The AWK Programming
Language" by Aho, Kernighan, and Weinberger, published in 1988.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Re: writing a good gsub regexp for matching between two specific characters

<tur33v$iqvi$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1399&group=comp.lang.awk#1399

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific
characters
Date: Wed, 15 Mar 2023 01:22:23 +0100
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <tur33v$iqvi$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<tuqv4m$i6t6$1@dont-email.me> <87fsa699rj.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 15 Mar 2023 00:22:23 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="db3ccb994c9f0c1e9d2d9ce18cb550cc";
logging-data="617458"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4rabL44Fw6V0omcAktcVl"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:tWjfyflVc+ZeReZG0vqMmPqP7Ig=
In-Reply-To: <87fsa699rj.fsf@bsb.me.uk>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Wed, 15 Mar 2023 00:22 UTC

On 15.03.2023 00:46, Ben Bacarisse wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>
>> On 14.03.2023 14:55, Bryan wrote:
>>> I noticed in the "Computerphile" video with Brian Kernighan - shared
>>> on this user group - that a new version of The Awk Book might be in
>>> the works as of August 2022.
>>
>> I cannot find a new version of the original Awk book with Google
>> (or other commercial providers). Could you provide a link, please?
>>
>> Or are you speaking about Arnold Robbin's book? (Especially since
>> below you mention GNU and the FSF.)
>>
>> I'm certainly confused by your mention of Brian Kernighan, one of
>> the authors of the original book.
>
> Th phrase "might be in the works" means only that there is a possibility
> that a new edition might be in preparation. Is that's what's confusing?

It was various things that confused me (but not the "in works" per se):
- "might be in the works" vs. "the overnight delivery is in-hand now"
- "GNU" and "FSF" vs. "The [original][commercial] Awk Book"
- and the date "August 2022" I couldn't assign to both books mentioned

>
> Bryan is clearly talking about a new version of the original book, but
> he is referring to the most vague suggestion that there might, soon, be
> a new edition. As far as I can tell there isn't one, but there could be
> on "in the works" (i.e. in preparation).

I am certainly interested in any new version. Read his post as if he
already had got it. But I didn't find anything online.

Janis

Re: writing a good gsub regexp for matching between two specific characters

<0d279bad-1e97-4074-9e54-33480f099128n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1400&group=comp.lang.awk#1400

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:ac8:14f:0:b0:3bf:b8cc:58 with SMTP id f15-20020ac8014f000000b003bfb8cc0058mr56248qtg.5.1678894263318;
Wed, 15 Mar 2023 08:31:03 -0700 (PDT)
X-Received: by 2002:a05:6870:1b14:b0:17a:692c:2794 with SMTP id
hl20-20020a0568701b1400b0017a692c2794mr3425249oab.11.1678894263061; Wed, 15
Mar 2023 08:31:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Wed, 15 Mar 2023 08:31:02 -0700 (PDT)
In-Reply-To: <tur33v$iqvi$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:190:67f:67bb:fbe3:6e79:5677:f1d3;
posting-account=PtxH9gkAAAAGMw6wJDvB_vinyKd1zCKS
NNTP-Posting-Host: 2601:190:67f:67bb:fbe3:6e79:5677:f1d3
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me> <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com> <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com> <tuqv4m$i6t6$1@dont-email.me>
<87fsa699rj.fsf@bsb.me.uk> <tur33v$iqvi$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0d279bad-1e97-4074-9e54-33480f099128n@googlegroups.com>
Subject: Re: writing a good gsub regexp for matching between two specific characters
From: bryanlepore@gmail.com (Bryan)
Injection-Date: Wed, 15 Mar 2023 15:31:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1732
 by: Bryan - Wed, 15 Mar 2023 15:31 UTC

I apologize for the confusion!

I will make a note on the Brian Kernighan video thread - the video I listened to/watched when stuck (not a bad idea, IMHO).

Re: writing a good gsub regexp for matching between two specific characters

<tusu99$vl8b$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1402&group=comp.lang.awk#1402

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: mortonspam@gmail.com (Ed Morton)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific
characters
Date: Wed, 15 Mar 2023 12:12:09 -0500
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <tusu99$vl8b$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<tuqv4m$i6t6$1@dont-email.me> <87fsa699rj.fsf@bsb.me.uk>
<tur33v$iqvi$1@dont-email.me>
<0d279bad-1e97-4074-9e54-33480f099128n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 15 Mar 2023 17:12:09 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="90cd86d6223d0edae2558c8c175ca802";
logging-data="1037579"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BHHN6R6PrQQAfoMVy6c0J"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Cancel-Lock: sha1:wYDy+ROxlFLCq0EoLGDipKzy1dQ=
In-Reply-To: <0d279bad-1e97-4074-9e54-33480f099128n@googlegroups.com>
X-Antivirus-Status: Clean
Content-Language: en-US
X-Antivirus: Avast (VPS 230315-0, 3/14/2023), Outbound message
 by: Ed Morton - Wed, 15 Mar 2023 17:12 UTC

On 3/15/2023 10:31 AM, Bryan wrote:
> I apologize for the confusion!
>
> I will make a note on the Brian Kernighan video thread - the video I listened to/watched when stuck (not a bad idea, IMHO).

You're posting on usenet, not a forum, so please make sure every post
has enough context included to make sense stand-alone. Right now you're
truncating/removing all context on all of your posts.

Thanks.

Re: writing a good gsub regexp for matching between two specific characters

<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1479&group=comp.lang.awk#1479

  copy link   Newsgroups: comp.lang.awk
X-Received: by 2002:a05:600c:214f:b0:3fe:253e:76e5 with SMTP id v15-20020a05600c214f00b003fe253e76e5mr15509wml.6.1690863080006;
Mon, 31 Jul 2023 21:11:20 -0700 (PDT)
X-Received: by 2002:a9d:67d8:0:b0:6b9:a8e1:a82b with SMTP id
c24-20020a9d67d8000000b006b9a8e1a82bmr13905241otn.5.1690863079302; Mon, 31
Jul 2023 21:11:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.88.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.awk
Date: Mon, 31 Jul 2023 21:11:18 -0700 (PDT)
In-Reply-To: <87zg8eopw3.fsf@nosuchdomain.example.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:7000:3c3d:41c0:d486:2225:17b5:f3;
posting-account=n74spgoAAAAZZyBGGjbj9G0N4Q659lEi
NNTP-Posting-Host: 2603:7000:3c3d:41c0:d486:2225:17b5:f3
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me> <13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com> <a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com> <87zg8eopw3.fsf@nosuchdomain.example.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
Subject: Re: writing a good gsub regexp for matching between two specific characters
From: jason.cy.kwan@gmail.com (Kpop 2GM)
Injection-Date: Tue, 01 Aug 2023 04:11:19 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Kpop 2GM - Tue, 1 Aug 2023 04:11 UTC

> "The Awk Book" presumably refers to the original "The AWK Programming
> Language" by Aho, Kernighan, and Weinberger, published in 1988.

I've seen the entirety of the original 1988 book scanned and viewable in PDF format online

( I'll refrain from linking it here since I'm uncertain about copyrights of the PDFs, but shouldn't be too hard to locate via google search or somewhere on github )

That said, even the original authors didn't do a particular good job at selling awk's real strengths. If i began my awk journey with that book, I would've jumped ship to perl longlong ago.

thank goodness I didn't step into that sarlacc pit that is perl5, or worse, raku.

The 4Chan Teller

#####################

The Book - "The AWK Programming Language"

<uab7qe$3mm4r$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1481&group=comp.lang.awk#1481

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: The Book - "The AWK Programming Language"
Date: Tue, 1 Aug 2023 17:19:41 +0200
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <uab7qe$3mm4r$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<87zg8eopw3.fsf@nosuchdomain.example.com>
<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Aug 2023 15:19:42 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="67a0cbfdf4b728875efb956287fb8603";
logging-data="3889307"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186h4vvtdgILCCje9ks3h/5"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:eeIOnqCUVaZtlxv+uNzb6GLbjYs=
In-Reply-To: <01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Tue, 1 Aug 2023 15:19 UTC

On 01.08.2023 06:11, Kpop 2GM wrote:
>> "The Awk Book" presumably refers to the original "The AWK
>> Programming Language" by Aho, Kernighan, and Weinberger, published
>> in 1988.
>
> That said, even the original authors didn't do a particular good job
> at selling awk's real strengths.

When I had first read about the awk command I was curiously looking
for more detailed information than just "it's a language to process
text patterns", so I was quite glad to find that book. It came out
very quickly, only a year after the official release (three years
after the stable version had been developed). The book is very well
written and provides everything you need to understand the concepts
of Awk which are, IMO, the "real strengths" of the Awk language. Of
course it's not a long developed "hacker book" with tips and tricks.
Neither does it has all that fancy stuff that we were publishing or
discussing here in this newsgroup during the past decades. I agree
with you, though, that there wasn't - maybe still isn't - anything
worth on that "hacker-level". But I wouldn't blame that old book or
their authors for this deficiency. After all folks who came up with
advanced ideas likely read that book (and maybe other later sources)
to develop application ideas that the original authors did not have
in mind.

And I also think that the more advanced methods that contribute to
Awk's strengths further would likely have repelled possible users;
many are cryptic and not too easy to understand for newbies. - The
book was, IMHO, exactly what was necessary at that time! - I would
still recommend it to Awk-beginners, even today.[*]

> If i began my awk journey with that
> book, I would've jumped ship to perl longlong ago.

I had been starting with that book (and a brain that came for free),
and nothing else. (And at times I'm still locking into that book to
look up things.)

With which sources have you "began [your] awk journey", since you
seem to avoid Perl and enjoy Awk on an advanced level?

Janis

[*] With the cutback of the unpleasantly high price of the booklet.

Re: The Book - "The AWK Programming Language"

<uabq51$1jo1$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1483&group=comp.lang.awk#1483

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: someone@invalid.invalid (jeorge)
Newsgroups: comp.lang.awk
Subject: Re: The Book - "The AWK Programming Language"
Date: Tue, 1 Aug 2023 14:32:33 -0600
Organization: Ministry of Madness
Message-ID: <uabq51$1jo1$1@nnrp.usenet.blueworldhosting.com>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<87zg8eopw3.fsf@nosuchdomain.example.com>
<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
<uab7qe$3mm4r$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Aug 2023 20:32:33 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="YKRG+wcUE3ZH5QknWLsQFQjWpafUZ9Hi6Jg7DGavMDA";
logging-data="52993"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.1
Cancel-Lock: sha1:VshgOM5nS/N2ldMoxOjvIqyu6Z4= sha256:FymYuMew9jb26gRmg1/lIn4PD5gzUBhBHKAOZ0SFFZo=
sha1:zptOnYcAvxFab4mPYOLezP6wp9s= sha256:KF87uSLQsB4eI5pYO0vmsff61YPdSGF+vsWsLW5blJg=
Content-Language: en-US
In-Reply-To: <uab7qe$3mm4r$1@dont-email.me>
 by: jeorge - Tue, 1 Aug 2023 20:32 UTC

On 8/1/23 9:19 AM, Janis Papanagnou wrote:
> On 01.08.2023 06:11, Kpop 2GM wrote:
>>> "The Awk Book" presumably refers to the original "The AWK
>>> Programming Language" by Aho, Kernighan, and Weinberger, published
>>> in 1988.
<snip>
> .. I would still recommend it to Awk-beginners, even today.[*]
<snip>> [*] With the cutback of the unpleasantly high price of the booklet.

Speaking of, I came across an announcement of a new edition:

The AWK Programming Language, Second Edition
https://awk.dev/
"The book will be available by the end of September."

Re: The Book - "The AWK Programming Language"

<uabrtr$3oup3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1484&group=comp.lang.awk#1484

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: The Book - "The AWK Programming Language"
Date: Tue, 1 Aug 2023 23:02:51 +0200
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <uabrtr$3oup3$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<87zg8eopw3.fsf@nosuchdomain.example.com>
<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
<uab7qe$3mm4r$1@dont-email.me>
<uabq51$1jo1$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 1 Aug 2023 21:02:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="67a0cbfdf4b728875efb956287fb8603";
logging-data="3963683"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sbIKYGjecJslzFKlfRrMV"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:vEHcTD4yWhvWGyFoBchrq8NxfB4=
In-Reply-To: <uabq51$1jo1$1@nnrp.usenet.blueworldhosting.com>
 by: Janis Papanagnou - Tue, 1 Aug 2023 21:02 UTC

On 01.08.2023 22:32, jeorge wrote:
> On 8/1/23 9:19 AM, Janis Papanagnou wrote:
>> On 01.08.2023 06:11, Kpop 2GM wrote:
>>>> "The Awk Book" presumably refers to the original "The AWK
>>>> Programming Language" by Aho, Kernighan, and Weinberger, published
>>>> in 1988.
> <snip>
>> .. I would still recommend it to Awk-beginners, even today.[*]
> <snip>> [*] With the cutback of the unpleasantly high price of the booklet.
>
> Speaking of, I came across an announcement of a new edition:
>
> The AWK Programming Language, Second Edition
> https://awk.dev/
> "The book will be available by the end of September."

It would be interesting to know whether it's just a reprint or
a reworked (updated/enhanced/extended) edition.

Janis

Re: writing a good gsub regexp for matching between two specific characters

<87cz06mpmy.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1485&group=comp.lang.awk#1485

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: writing a good gsub regexp for matching between two specific characters
Date: Tue, 01 Aug 2023 14:14:29 -0700
Organization: None to speak of
Lines: 24
Message-ID: <87cz06mpmy.fsf@nosuchdomain.example.com>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<87zg8eopw3.fsf@nosuchdomain.example.com>
<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="cf163eef2e6d3fe4b73e25e19dd6ab37";
logging-data="3966379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/c/1Z6L+aXXZXcbzFqhU5O"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:c1rXZBogh/ABHAsdyCu8ErEWUVw=
sha1:dG6MMQg4t/oIXbVVyMgFhfcvjlE=
 by: Keith Thompson - Tue, 1 Aug 2023 21:14 UTC

Kpop 2GM <jason.cy.kwan@gmail.com> writes:
>> "The Awk Book" presumably refers to the original "The AWK Programming
>> Language" by Aho, Kernighan, and Weinberger, published in 1988.
>
> I've seen the entirety of the original 1988 book scanned and viewable in PDF format online
>
> ( I'll refrain from linking it here since I'm uncertain about
> copyrights of the PDFs, but shouldn't be too hard to locate via google
> search or somewhere on github )

I'm far more certain. The 1988 book is still under copyright, and any
PDF copy that's not explicitly authorized by the publisher is in
violation of that copyright.

(The 1988 AWK book doesn't appear to be available in electronic form.
Amazon has it in paperback for $114.71. The second edition is supposed
to be available 2023-09-22, at a much more reasonable price.)

[...]

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: The Book - "The AWK Programming Language"

<875y5ympch.fsf@nosuchdomain.example.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1486&group=comp.lang.awk#1486

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: The Book - "The AWK Programming Language"
Date: Tue, 01 Aug 2023 14:20:46 -0700
Organization: None to speak of
Lines: 34
Message-ID: <875y5ympch.fsf@nosuchdomain.example.com>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<87zg8eopw3.fsf@nosuchdomain.example.com>
<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
<uab7qe$3mm4r$1@dont-email.me>
<uabq51$1jo1$1@nnrp.usenet.blueworldhosting.com>
<uabrtr$3oup3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="cf163eef2e6d3fe4b73e25e19dd6ab37";
logging-data="3966379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+Phfx40qIUuidjAjcB7+n"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:yzmrADyvcGmoh+TNGuOi5I95pTw=
sha1:kLKNS4J6bOvfTK3HmAc5BZ9ltnw=
 by: Keith Thompson - Tue, 1 Aug 2023 21:20 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
> On 01.08.2023 22:32, jeorge wrote:
>> On 8/1/23 9:19 AM, Janis Papanagnou wrote:
>>> On 01.08.2023 06:11, Kpop 2GM wrote:
>>>>> "The Awk Book" presumably refers to the original "The AWK
>>>>> Programming Language" by Aho, Kernighan, and Weinberger, published
>>>>> in 1988.
>> <snip>
>>> .. I would still recommend it to Awk-beginners, even today.[*]
>> <snip>> [*] With the cutback of the unpleasantly high price of the booklet.
>>
>> Speaking of, I came across an announcement of a new edition:
>>
>> The AWK Programming Language, Second Edition
>> https://awk.dev/
>> "The book will be available by the end of September."
>
> It would be interesting to know whether it's just a reprint or
> a reworked (updated/enhanced/extended) edition.

A mere reprint would not be called the "Second Edition".

From the cited web page:

The first edition was written by Al Aho, Brian Kernighan and Peter
Weinberger in 1988. Awk has evolved since then, there are multiple
implementations, and of course the computing world has changed
enormously. The new edition of the Awk book reflects some of those
changes.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

Re: The Book - "The AWK Programming Language"

<uac18h$3pi7m$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=1487&group=comp.lang.awk#1487

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: The Book - "The AWK Programming Language"
Date: Wed, 2 Aug 2023 00:33:52 +0200
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <uac18h$3pi7m$1@dont-email.me>
References: <0b37736e-a7e1-45ff-965a-c3278dc25178n@googlegroups.com>
<tujepc$2so2r$1@dont-email.me>
<13052000-b214-4a5f-8b4b-7a3f09986af3n@googlegroups.com>
<tukvr6$107tu$1@news.xmission.com>
<a2e862e5-b70b-4734-8c8c-06c121598ad2n@googlegroups.com>
<tulgvi$38dnd$1@dont-email.me> <tuo32v$3u6ta$1@dont-email.me>
<8b627b42-d136-4493-a861-692ae198c344n@googlegroups.com>
<87zg8eopw3.fsf@nosuchdomain.example.com>
<01c74c85-10d5-4ab1-b6ed-6f6a75e11096n@googlegroups.com>
<uab7qe$3mm4r$1@dont-email.me>
<uabq51$1jo1$1@nnrp.usenet.blueworldhosting.com>
<uabrtr$3oup3$1@dont-email.me> <875y5ympch.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 1 Aug 2023 22:33:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0cfd111b660d7ff0ebd5a5a30442a769";
logging-data="3983606"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187mgzNV1BH7tPQ2IknxoeK"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:Sr+nuGZMs3mP2yg/b1b757pfKfc=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <875y5ympch.fsf@nosuchdomain.example.com>
 by: Janis Papanagnou - Tue, 1 Aug 2023 22:33 UTC

On 01.08.2023 23:20, Keith Thompson wrote:
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>>
>> It would be interesting to know whether it's just a reprint or
>> a reworked (updated/enhanced/extended) edition.
>
> A mere reprint would not be called the "Second Edition".

Ah, okay, thanks for the hint.[*]

I can only speak from publishers hereabouts; "zweite Auflage" (en.
"second edition") just means a new edition after the first one, and
if there isn't anything mentioned like "überarbeitete" (en. revised),
"verbesserte" (en. improved), "durchgesehene" (en. revised version),
"korrigierte" (en. corrected), "erweiterte" (en. extended), or many
other possible adjectives declaring the type of the edition, then
it's usually (or even generally?) just a reprint because of new or
significant more customer demands than originally expected.

> From the cited web page:
> [...]

And thanks for the quote. (I could have looked it up myself but was
too lazy.)

Janis

[*] Though I have also seen in the English domain books that have a
note "rev. ed." adjective (e.g. Bolsky, Korn), so I guess it varies?

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor