Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Every program is a part of some other program, and rarely fits.


devel / comp.lang.awk / mHash for awk

SubjectAuthor
* mHash for awkMike Sanders
+* Re: mHash for awkKeith Thompson
|`- Re: mHash for awkMike Sanders
`* Re: mHash for awkMike Sanders
 +- Re: mHash for awkMike Sanders
 +* OT: Wow! ZOC!! (Was: mHash for awk)Kenny McCormack
 |`* Re: OT: Wow! ZOC!!Mike Sanders
 | `* Re: OT: Wow! ZOC!!Kenny McCormack
 |  `- Re: OT: Wow! ZOC!!Mike Sanders
 `* Re: mHash for awkBen Bacarisse
  +* Re: mHash for awkMike Sanders
  |`- Re: mHash for awkMike Sanders
  +* Re: mHash for awkMike Sanders
  |`* Re: mHash for awkMike Sanders
  | `* Re: mHash for awkMike Sanders
  |  `* Re: mHash for awkJanis Papanagnou
  |   `* Re: mHash for awkJanis Papanagnou
  |    `* Re: mHash for awkMike Sanders
  |     `* Re: mHash for awkJanis Papanagnou
  |      `* Re: mHash for awkJanis Papanagnou
  |       `- Re: mHash for awkMike Sanders
  `* Re: mHash for awkMike Sanders
   `* Re: mHash for awkBen Bacarisse
    `- Re: mHash for awkMike Sanders

1
mHash for awk

<uf0247$2p33k$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: mHash for awk
Date: Wed, 27 Sep 2023 01:56:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 15
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf0247$2p33k$1@dont-email.me>
Injection-Date: Wed, 27 Sep 2023 01:56:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7c0002442be579e31fa78b63894e032e";
logging-data="2919540"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19iFTs2XP784/hd2NlQh7RC"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:5oMSNKG7KczlVsc4x592TTRA4cY=
 by: Mike Sanders - Wed, 27 Sep 2023 01:56 UTC

Ecsuse the noise folks. To clear up any confusion...

In a hurry the last few days & I named a function I wrote after an
exsisting hash named dbj2. Bad idea on my part, so please allow me
to own my mistake & take full responsibilty. The code has been
renamed to "mHash" (using Camel case) meaning "Mike's Hash".

mHash info here:

https://porkchop.neocities.org/notes/mHash.txt

--
:wq
Mike Sanders

Re: mHash for awk

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

  copy mid

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

  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....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Tue, 26 Sep 2023 20:35:49 -0700
Organization: None to speak of
Lines: 18
Message-ID: <87ttrgs2y2.fsf@nosuchdomain.example.com>
References: <uf0247$2p33k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="08e30d084ec8438dcadf9cbd76f2c53f";
logging-data="3070503"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FktLIO815D01wj48PTM4l"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:s9tD9IQ4ZWQYCZVl1IS0wi0C638=
sha1:jypM7k1sKiJXSMZUC/e5MHnO4qA=
 by: Keith Thompson - Wed, 27 Sep 2023 03:35 UTC

porkchop@invalid.foo (Mike Sanders) writes:
> Ecsuse the noise folks. To clear up any confusion...
>
> In a hurry the last few days & I named a function I wrote after an
> exsisting hash named dbj2. Bad idea on my part, so please allow me
> to own my mistake & take full responsibilty. The code has been
> renamed to "mHash" (using Camel case) meaning "Mike's Hash".
>
> mHash info here:
>
> https://porkchop.neocities.org/notes/mHash.txt

Glad you changed your mind.

--
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: mHash for awk

<uf0ulv$31b0h$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Wed, 27 Sep 2023 10:03:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf0ulv$31b0h$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <87ttrgs2y2.fsf@nosuchdomain.example.com>
Injection-Date: Wed, 27 Sep 2023 10:03:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6fe25f3b75fac0b902b81cc965bfc872";
logging-data="3189777"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v04wt4iptH3m2fJHJvnBt"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:fDsGOooDmmul5z98JemaRxn8pNk=
 by: Mike Sanders - Wed, 27 Sep 2023 10:03 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:

> Glad you changed your mind.

Well, certainly would've been ignoble to've done otherwise.

Actually a good thing in some respects as I can concentrate
on the key idea (there's two differing ideas running through
the code right now).

--
:wq
Mike Sanders

Re: mHash for awk

<uf30ij$3hmge$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 04:48:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 73
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf30ij$3hmge$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me>
Injection-Date: Thu, 28 Sep 2023 04:48:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="750f8b2003a8ce47021b11978c181df1";
logging-data="3725838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+x8UWnjP0BmN7VBnqne07M"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:rnhQAytRYyylzfoV3we0/hQTfmg=
 by: Mike Sanders - Thu, 28 Sep 2023 04:48 UTC

Hey folks, quick update as promised elsewhere (plus easier this way):

Yes the website was taken down. Long story short, a bad presence
here that I simply cant work with anymore, too much drama.

Here's something, in over 3 hours time, 52 of you did visit & 13
downloaded the mHash() draft, which I thought was nifty, appreciate it.

Nah dbj2 is not an issue, I was moving so quickly I simply did not consider
choosing another name for the function. A knuckle-headed oversite when you
consider I did the same thing a few days prior when I wrote a function named
ord(). Trust me, a very humbling snafu to have done so publicly twice in a
week's time.

I use ZOC: https://www.emtec.com/zoc/index.html

No not going anywhere, but life often seeks its own level, its all good. =)

Yep, mHash will be available again, but this time only via email. Any how,
let's check it out (sorry if its too terse)...

First the new function signature: mHash(str, key, hash, x, y, ascii)

Example usage: hash = mHash(my_input, my_key)

Example csv file (we'll choose sally, her hash is
the number directly below in the same column):

# jenny, sally, wendy

4044119583, 156734252, 0782926302
apple, she, pear
these, knows, another
fubar, how, blurb

Example commandline invocation:

awk -vNAME=sally -vKEY=2147483647 -f script.awk data.csv

Example script, we'll constrain processing *exclusively* to sally's column

BEGIN {

FS = "," # set field separator to comma
UNLOCK = 0 # when > 0, column is 'unlocked'
HASH = mHash(NAME, KEY) # initialize hash & lets go...

}

NR == 3 { # start @ 3rd line
for (x = 1; x <= NF; x++) {
if ($x ~ HASH) {
UNLOCK = x;
break;
}
}
}

NR > 3 && UNLOCK {print $UNLOCK} # if unlocked, print only sally's column

# eof

Hey, thanks again!

--
:wq
Mike Sanders

Re: mHash for awk

<uf30oq$3hmge$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 04:51:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf30oq$3hmge$2@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
Injection-Date: Thu, 28 Sep 2023 04:51:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="750f8b2003a8ce47021b11978c181df1";
logging-data="3725838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lwCLKBpr9phdF79SntBbG"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:5lQkx7TKkhMoPqIUQLUrsncSrxw=
 by: Mike Sanders - Thu, 28 Sep 2023 04:51 UTC

Mike Sanders <porkchop@invalid.foo> wrote:

> Nah dbj2...

Typo, I mean djb2

--
:wq
Mike Sanders

OT: Wow! ZOC!! (Was: mHash for awk)

<uf35p6$1f002$1@news.xmission.com>

  copy mid

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

  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: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.awk
Subject: OT: Wow! ZOC!! (Was: mHash for awk)
Date: Thu, 28 Sep 2023 06:17:10 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uf35p6$1f002$1@news.xmission.com>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
Injection-Date: Thu, 28 Sep 2023 06:17:10 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1540098"; 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 - Thu, 28 Sep 2023 06:17 UTC

In article <uf30ij$3hmge$1@dont-email.me>,
Mike Sanders <porkchop@invalid.foo> wrote:
....
>I use ZOC: https://www.emtec.com/zoc/index.html

Wow! Haven't heard anything about ZOC in decades. Does it still exist?
In what form? What has it evolved into?
(Just out of curiosity, why *did* you mention it here?)

Note: I used ZOC way back when in OS/2 days - for serial comms only.
Nobody uses serial anymore (and if they did, all you need is screen(1)), so
is there any point in ZOC anymore?

Note; I really liked it - back in OS/2 days, so don't take any of this as
slagging it or as negativity.

--
(Cruz certainly has an odd face) ... it looks like someone sewed pieces of a
waterlogged Reagan mask together at gunpoint ...

http://www.rollingstone.com/politics/news/how-america-made-donald-trump-unstoppable-20160224

Re: OT: Wow! ZOC!!

<uf37hs$3ins4$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: OT: Wow! ZOC!!
Date: Thu, 28 Sep 2023 06:47:24 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 44
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf37hs$3ins4$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <uf35p6$1f002$1@news.xmission.com>
Injection-Date: Thu, 28 Sep 2023 06:47:24 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="750f8b2003a8ce47021b11978c181df1";
logging-data="3760004"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Z0JY+CI63yFsih1TOc7/7"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:4YCcKYdfThJNzRInySkx49MxEsU=
 by: Mike Sanders - Thu, 28 Sep 2023 06:47 UTC

Kenny McCormack <gazelle@shell.xmission.com> wrote:

> Wow! Haven't heard anything about ZOC in decades. Does it still exist?
> In what form? What has it evolved into?
> (Just out of curiosity, why *did* you mention it here?)

Dude you should see it these days! Even custom scripting using REXX
(popular on IBM mainframes, really great under Windows whitch seems
to lack anything worth using scriptwise natively):

https://en.wikipedia.org/wiki/Rexx

Well, this whole *debacle* (I always wanted my own debacle!) caused
a spat of emails on my end & since I was anwsering them here, I
included a question from a gentleman (who should consider posting
- sorry if you're reading), but is maybe a little reluctant to do
so, or then again, maybe he's right on the money. Anyhow, he wants
ZMODEM xfer protocol.

> Note: I used ZOC way back when in OS/2 days - for serial comms only.
> Nobody uses serial anymore (and if they did, all you need is screen(1)),
> so is there any point in ZOC anymore?

I use it as it has a tabbed interface, & more options than I could ever
use.

Funny you should mention serial coms... my 1st NIX was Minix. Went out &
built a barebones serial cable myself, took me 4 attempts to get it right.
Then I was logging into my Minix boxen from DOS using Kermit, & daydreaming
of being an 'admin'. Man such a great time...

> Note; I really liked it - back in OS/2 days, so don't take any of this as
> slagging it or as negativity.

OS/2! Just a little before my time. Always thought it looked pretty powerful
compared to Windows.

Nah its all good Kenny. Nice to hear from you again. I see you're still out
in the world & kicking. I've learned *alot* from your posts over the years...

--
:wq
Mike Sanders

Re: mHash for awk

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

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 13:39:26 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <87v8bueakh.fsf@bsb.me.uk>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1432f0dee4a59f52e97231a9b3a0897f";
logging-data="3878986"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ifBYOKPUu7tchDBwMr7P2hzlQ2ZleNtk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:3eS+fkTkinkDJ5s9ead5M5CvEHM=
sha1:vUJXzYP/Sk4Qd0idxaH8kOG+cD8=
X-BSB-Auth: 1.7bcf891f4d3d7ad08f72.20230928133926BST.87v8bueakh.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 28 Sep 2023 12:39 UTC

porkchop@invalid.foo (Mike Sanders) writes:

> Example csv file (we'll choose sally, her hash is
> the number directly below in the same column):
>
> # jenny, sally, wendy
>
> 4044119583, 156734252, 0782926302
> apple, she, pear
> these, knows, another
> fubar, how, blurb
>
>
> Example commandline invocation:
>
> awk -vNAME=sally -vKEY=2147483647 -f script.awk data.csv
>
>
> Example script, we'll constrain processing *exclusively* to sally's column
>
> BEGIN {
>
> FS = "," # set field separator to comma
> UNLOCK = 0 # when > 0, column is 'unlocked'
> HASH = mHash(NAME, KEY) # initialize hash & lets go...
>
> }
>
> NR == 3 { # start @ 3rd line
> for (x = 1; x <= NF; x++) {
> if ($x ~ HASH) {
> UNLOCK = x;
> break;
> }
> }
> }
>
> NR > 3 && UNLOCK {print $UNLOCK} # if unlocked, print only sally's column

As presented, this is just a complex way of selecting a column so there
must be some context you are considering that provides the actual
security because, as it stands, anyone who can run that awk command can
run a much simpler one to look at any data they like. How do you think
this would be used?

--
Ben.

Re: mHash for awk

<uf4jl1$3qold$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 19:20:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf4jl1$3qold$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk>
Injection-Date: Thu, 28 Sep 2023 19:20:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="750f8b2003a8ce47021b11978c181df1";
logging-data="4022957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gzqn4D4SCLd7rsnn7eRPu"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:mpc3OAG4ut3UVxzUfylSTUM665A=
 by: Mike Sanders - Thu, 28 Sep 2023 19:20 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> As presented, this is just a complex way of selecting a column so there
> must be some context you are considering that provides the actual
> security because, as it stands, anyone who can run that awk command can
> run a much simpler one to look at any data they like. How do you think
> this would be used?

Oh yeah, simply plugin: '156734252'

Have alot of ideas, some already solved, but not yet to my satisfaction.
Time will tell.

--
:wq
Mike Sanders

Re: mHash for awk

<uf4l2c$3r4mo$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!news.hispagatos.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 19:44:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf4l2c$3r4mo$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk> <uf4jl1$3qold$1@dont-email.me>
Injection-Date: Thu, 28 Sep 2023 19:44:12 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="750f8b2003a8ce47021b11978c181df1";
logging-data="4035288"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yDlQoQPRL3lXfVeCcHaH1"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:EJn/gZeiU+y7z6OtPtdlLjA4SZk=
 by: Mike Sanders - Thu, 28 Sep 2023 19:44 UTC

Mike Sanders <porkchop@invalid.foo> wrote:

> Oh yeah, simply plugin: '156734252'

Forgot to add: print $2

--
:wq
Mike Sanders

Re: mHash for awk

<uf4uin$3sqjv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 22:26:31 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf4uin$3sqjv$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk>
Injection-Date: Thu, 28 Sep 2023 22:26:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="4090495"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/agD5WP9OH0bYkEInH94bd"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:FrD4lCQyHZ15g6N0Tq/3zPKCUyk=
 by: Mike Sanders - Thu, 28 Sep 2023 22:26 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

[...]

One thing I do wonder about is wheather or not
this is valid under Windows:

if (y < 1) print "error" > "/dev/stderr"

In Windows, its simply 'nul' in the current directory.

On my end, in Windows, printing to "/dev/stderr" works
just fine with either mawk or busybox's awk. Still, I'm
skeptical if that's good form under Windows...

--
:wq
Mike Sanders

Re: mHash for awk

<uf4v2v$3st7b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 22:35:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 21
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf4v2v$3st7b$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me>
Injection-Date: Thu, 28 Sep 2023 22:35:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="4093163"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+L7tSoDr7Tv42S1DRlRtUg"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:onXeIthHMn7fa7W8dgGVKVYanlE=
 by: Mike Sanders - Thu, 28 Sep 2023 22:35 UTC

Mike Sanders <porkchop@invalid.foo> wrote:

> One thing I do wonder about is wheather or not
> this is valid under Windows:
>
> if (y < 1) print "error" > "/dev/stderr"
>
> In Windows, its simply 'nul' in the current directory.

No not 'nul' (got ahead of myself), rather:

stdin: 0
stdout: 1
stderr: 2

Still using /dev under Windows seems odd.

--
:wq
Mike Sanders

Re: mHash for awk

<uf4vc5$3t09e$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Thu, 28 Sep 2023 22:40:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf4vc5$3t09e$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me> <uf4v2v$3st7b$1@dont-email.me>
Injection-Date: Thu, 28 Sep 2023 22:40:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="4096302"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193oYlnATXDHJZNnF5ieL1s"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:EoU3Vo2cuoKBqW9vbeHKiud8UaI=
 by: Mike Sanders - Thu, 28 Sep 2023 22:40 UTC

Mike Sanders <porkchop@invalid.foo> wrote:

> Mike Sanders <porkchop@invalid.foo> wrote:
>
>> One thing I do wonder about is wheather or not
>> this is valid under Windows:
>>
>> if (y < 1) print "error" > "/dev/stderr"
>>
>> In Windows, its simply 'nul' in the current directory.
>
> No not 'nul' (got ahead of myself), rather:
>
> stdin: 0
> stdout: 1
> stderr: 2
>
> Still using /dev under Windows seems odd.

This works, but feels like a hack if ever there was:

print "this is win stderr" | "cmd /c more 1>&2"

invoke a shell, pipe to more...

--
:wq
Mike Sanders

Re: mHash for awk

<uf556m$3u0nf$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Fri, 29 Sep 2023 02:19:34 +0200
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <uf556m$3u0nf$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
<87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me>
<uf4v2v$3st7b$1@dont-email.me> <uf4vc5$3t09e$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Sep 2023 00:19:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9acdff2a71cda0a9019c7a328d13d756";
logging-data="4129519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XP/LXoU5gPi2hAHSi39Tf"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:xU2I5HRs3k4cay0U1B0Bn/yLoZE=
In-Reply-To: <uf4vc5$3t09e$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Fri, 29 Sep 2023 00:19 UTC

On 29.09.2023 00:40, Mike Sanders wrote:
> Mike Sanders <porkchop@invalid.foo> wrote:
>
>> Mike Sanders <porkchop@invalid.foo> wrote:
>>
>>> One thing I do wonder about is wheather or not
>>> this is valid under Windows:
>>>
>>> if (y < 1) print "error" > "/dev/stderr"
>>>
>>> In Windows, its simply 'nul' in the current directory.
>>
>> No not 'nul' (got ahead of myself), rather:
>>
>> stdin: 0
>> stdout: 1
>> stderr: 2
>>
>> Still using /dev under Windows seems odd.
>
> This works, but feels like a hack if ever there was:
>
> print "this is win stderr" | "cmd /c more 1>&2"
>
> invoke a shell, pipe to more...
>

(This is probably a question for a Windows/DOS newsgroup
and likely off-topic here. Anyway. Let's make guesses...)

Does DOS support a 'cat' command? - If so then you can maybe
use one of the redirection patterns that are also suggested
for Unix...

print "error" | "cat 1>&2"

(Or maybe the DOS'es 'type' command may replace 'cat' here?)

For Unix (to be tried out for DOS) there's also

print "error" > "/dev/tty"

to get the message directly to the terminal in case that is
the basic requirement, as opposed to redirecting it to FD:2
(which may or may not be the terminal depending on settings
in the surrounding environment).

Janis

Re: mHash for awk

<uf55j0$3u3ff$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Fri, 29 Sep 2023 02:26:08 +0200
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <uf55j0$3u3ff$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
<87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me>
<uf4v2v$3st7b$1@dont-email.me> <uf4vc5$3t09e$1@dont-email.me>
<uf556m$3u0nf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Sep 2023 00:26:08 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9acdff2a71cda0a9019c7a328d13d756";
logging-data="4132335"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AmwcaF6TS4Vetx9ysNdAm"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:nHuGl8jSKgczLMTMbcHMoFZ1K7s=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uf556m$3u0nf$1@dont-email.me>
 by: Janis Papanagnou - Fri, 29 Sep 2023 00:26 UTC

On 29.09.2023 02:19, Janis Papanagnou wrote:
> On 29.09.2023 00:40, Mike Sanders wrote:
>> Mike Sanders <porkchop@invalid.foo> wrote:
>>
>>> Mike Sanders <porkchop@invalid.foo> wrote:
>>>
>>>> One thing I do wonder about is wheather or not
>>>> this is valid under Windows:
>>>>
>>>> if (y < 1) print "error" > "/dev/stderr"
>>>>
>>>> In Windows, its simply 'nul' in the current directory.
>>>
>>> No not 'nul' (got ahead of myself), rather:
>>>
>>> stdin: 0
>>> stdout: 1
>>> stderr: 2
>>>
>>> Still using /dev under Windows seems odd.
>>
>> This works, but feels like a hack if ever there was:
>>
>> print "this is win stderr" | "cmd /c more 1>&2"
>>
>> invoke a shell, pipe to more...
>>
>
> (This is probably a question for a Windows/DOS newsgroup
> and likely off-topic here. Anyway. Let's make guesses...)
>
>
> Does DOS support a 'cat' command? - If so then you can maybe
> use one of the redirection patterns that are also suggested
> for Unix...
>
> print "error" | "cat 1>&2"
>
> (Or maybe the DOS'es 'type' command may replace 'cat' here?)
>
>
> For Unix (to be tried out for DOS) there's also
>
> print "error" > "/dev/tty"
>
> to get the message directly to the terminal in case that is
> the basic requirement, as opposed to redirecting it to FD:2
> (which may or may not be the terminal depending on settings
> in the surrounding environment).

And two or three more suggestions... (partly more drastic)

use system() with the DOS specific commands composed as string
concatenated argument.

If you have control over the system you are working on; install
a Cygwin environment and run it in that Unix emulation.

Use a partition on your Windows disk for a Linux emulation.
Or use a live version of Linux from an USB-stick to run that.

> Janis
>

Re: OT: Wow! ZOC!!

<uf5hir$1g5rj$1@news.xmission.com>

  copy mid

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

  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: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.awk
Subject: Re: OT: Wow! ZOC!!
Date: Fri, 29 Sep 2023 03:50:51 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uf5hir$1g5rj$1@news.xmission.com>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <uf35p6$1f002$1@news.xmission.com> <uf37hs$3ins4$1@dont-email.me>
Injection-Date: Fri, 29 Sep 2023 03:50:51 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1578867"; 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 - Fri, 29 Sep 2023 03:50 UTC

In article <uf37hs$3ins4$1@dont-email.me>,
Mike Sanders <porkchop@invalid.foo> wrote:
>Kenny McCormack <gazelle@shell.xmission.com> wrote:
>
>> Wow! Haven't heard anything about ZOC in decades. Does it still exist?
>> In what form? What has it evolved into?
>> (Just out of curiosity, why *did* you mention it here?)
>
>Dude you should see it these days! Even custom scripting using REXX
>(popular on IBM mainframes, really great under Windows whitch seems
>to lack anything worth using scriptwise natively):

I've never been at all impressed with/by REXX. Back when OS/2 was a thing,
they were always raving about it (and how great it is), but it always
looked ugly to me.

You could say that REXX is (was) JCL done right, but it is still JCL.
I.e., if you come from an IBM mainframe background (as a lot of OS/2'ers
did), and are used to less-than-great things like JCL, then REXX looks
great. But if you're coming from a Unix background, where good (and
sometimes wonderful) scripting languages are common, then REXX looks like,
well, not-so-great.

>Well, this whole *debacle* (I always wanted my own debacle!) caused
>a spat of emails on my end & since I was anwsering them here, I
>included a question from a gentleman (who should consider posting
>- sorry if you're reading), but is maybe a little reluctant to do
>so, or then again, maybe he's right on the money. Anyhow, he wants
>ZMODEM xfer protocol.

I don't understand this paragraph, but no matter.

>> Note: I used ZOC way back when in OS/2 days - for serial comms only.
>> Nobody uses serial anymore (and if they did, all you need is screen(1)),
>> so is there any point in ZOC anymore?
>
>I use it as it has a tabbed interface, & more options than I could ever
>use.

Do you run it under MS Windows, then?

Anyway, I may check ZOC out again - just for old times sake. I don't do
much with Windows anymore, though. Pretty much all Linux (and thus X
windows).

>Nah its all good Kenny. Nice to hear from you again. I see you're still out
>in the world & kicking. I've learned *alot* from your posts over the years...

I'm here all week.

--
Faith doesn't give you the answers; it just stops you from asking the questions.

Re: mHash for awk

<uf76tn$dj02$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Fri, 29 Sep 2023 19:01:11 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 46
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf76tn$dj02$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me> <uf4v2v$3st7b$1@dont-email.me> <uf4vc5$3t09e$1@dont-email.me> <uf556m$3u0nf$1@dont-email.me> <uf55j0$3u3ff$1@dont-email.me>
Injection-Date: Fri, 29 Sep 2023 19:01:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="445442"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vnJulg/DUoFWvEL2GOxxl"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:SxwS1Qnc24YfOsOqCyWPQixv8Nk=
 by: Mike Sanders - Fri, 29 Sep 2023 19:01 UTC

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

>> (This is probably a question for a Windows/DOS newsgroup
>> and likely off-topic here. Anyway. Let's make guesses...)
>>
>>
>> Does DOS support a 'cat' command? - If so then you can maybe
>> use one of the redirection patterns that are also suggested
>> for Unix...
>>
>> print "error" | "cat 1>&2"
>>
>> (Or maybe the DOS'es 'type' command may replace 'cat' here?)
>>
>>
>> For Unix (to be tried out for DOS) there's also
>>
>> print "error" > "/dev/tty"
>>
>> to get the message directly to the terminal in case that is
>> the basic requirement, as opposed to redirecting it to FD:2
>> (which may or may not be the terminal depending on settings
>> in the surrounding environment).
>
> And two or three more suggestions... (partly more drastic)
>
> use system() with the DOS specific commands composed as string
> concatenated argument.
>
> If you have control over the system you are working on; install
> a Cygwin environment and run it in that Unix emulation.
>
> Use a partition on your Windows disk for a Linux emulation.
> Or use a live version of Linux from an USB-stick to run that.

Janis these are really good options. I don't know what I'll wind
up with, but you've scored another hit in my notes. I like
system() as its intrinsic to most every awk.

Anyhow, as always appreciate it.

--
:wq
Mike Sanders

Re: OT: Wow! ZOC!!

<uf774o$dj02$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: OT: Wow! ZOC!!
Date: Fri, 29 Sep 2023 19:04:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf774o$dj02$2@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <uf35p6$1f002$1@news.xmission.com> <uf37hs$3ins4$1@dont-email.me> <uf5hir$1g5rj$1@news.xmission.com>
Injection-Date: Fri, 29 Sep 2023 19:04:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="445442"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+a7wngVzxBUf0Rx0FXDXjB"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:ud3P+Brv6elAdvXbNwhZDv++EYM=
 by: Mike Sanders - Fri, 29 Sep 2023 19:04 UTC

Kenny McCormack <gazelle@shell.xmission.com> wrote:

> I've never been at all impressed with/by REXX. Back when OS/2 was a thing,
> they were always raving about it (and how great it is), but it always
> looked ugly to me.

Oh yeah. As far as theses things go, it beats powershell IMO.
> You could say that REXX is (was) JCL done right, but it is still JCL.
> I.e., if you come from an IBM mainframe background (as a lot of OS/2'ers
> did), and are used to less-than-great things like JCL, then REXX looks
> great. But if you're coming from a Unix background, where good (and
> sometimes wonderful) scripting languages are common, then REXX looks like,
> well, not-so-great.

Must google JCL, I know nothing of it...
> I don't understand this paragraph, but no matter.

No biggie =)
> Do you run it under MS Windows, then?

Sure enough, but under Linux/BSD you wouldn't need it.
> I'm here all week.

Good deal.

--
:wq
Mike Sanders

Re: mHash for awk

<uf77fo$dj02$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Fri, 29 Sep 2023 19:10:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 31
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf77fo$dj02$3@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk>
Injection-Date: Fri, 29 Sep 2023 19:10:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="445442"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eaw18anW7UORgllAA7Lc/"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:th1oee46VJDwaIlgkRBwANyrN/w=
 by: Mike Sanders - Fri, 29 Sep 2023 19:10 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> there must be some context you are considering that provides the actual security

Yes, I think I've *just got it* Ben. Let me qualify it by saying
a: it considers only ASCII chars (other chars will simply pass though
as is), & b: my brain hurts...

Hope to roll it all together & post a conclusion probably next week, real life
work awaits just at the present. A quick preview shows I blow no smoke...

# init_map(password): Initializes and returns the substitution map based on
# the provided password. The password influences the ordering of characters
# in the map.
# # sanitize_password(password, base): Sanitizes the provided password by
# removing any character not present in the base character set. It also
# ensures that each character is unique in the sanitized password.
# # mCrypt(str, password, mode): Depending on the mode, it either encodes or
# decodes the input string str using the substitution cipher. Mode 1 is for
# encoding, and Mode 0 is for decoding. The function returns the transformed
# string.
# # The string variable 'base' contains all printable ASCII characters except
# newline ('\n'), which are in the range 32 to 126 inclusive.

--
:wq
Mike Sanders

Re: mHash for awk

<878r8obwkk.fsf@bsb.me.uk>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Fri, 29 Sep 2023 20:36:59 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <878r8obwkk.fsf@bsb.me.uk>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
<87v8bueakh.fsf@bsb.me.uk> <uf77fo$dj02$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="4dfdf850a714e5d3717da460fbf945f6";
logging-data="459813"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rjKblkIHSYyxSYrqyo4L9pCEimu82oWI="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:N5X02sJQByAlI/QyUWXpJKZx/w4=
sha1:fVK+OhPEI5Y3KQvRUBcY3o4IZLg=
X-BSB-Auth: 1.2b058f1dcbb232697dbe.20230929203700BST.878r8obwkk.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 29 Sep 2023 19:36 UTC

porkchop@invalid.foo (Mike Sanders) writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:
>
>> there must be some context you are considering that provides the actual security
>
> Yes, I think I've *just got it* Ben. Let me qualify it by saying
> a: it considers only ASCII chars (other chars will simply pass though
> as is), & b: my brain hurts...
>
> Hope to roll it all together & post a conclusion probably next week, real life
> work awaits just at the present. A quick preview shows I blow no smoke...
>
> # init_map(password): Initializes and returns the substitution map based on
> # the provided password. The password influences the ordering of characters
> # in the map.
> #
> # sanitize_password(password, base): Sanitizes the provided password by
> # removing any character not present in the base character set. It also
> # ensures that each character is unique in the sanitized password.
> #
> # mCrypt(str, password, mode): Depending on the mode, it either encodes or
> # decodes the input string str using the substitution cipher. Mode 1 is for
> # encoding, and Mode 0 is for decoding. The function returns the transformed
> # string.
> #
> # The string variable 'base' contains all printable ASCII characters except
> # newline ('\n'), which are in the range 32 to 126 inclusive.

Is this just fun side project or are real data going to be involved?

--
Ben.

Re: mHash for awk

<uf7ega$f0qi$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Fri, 29 Sep 2023 21:10:34 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf7ega$f0qi$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk> <uf77fo$dj02$3@dont-email.me> <878r8obwkk.fsf@bsb.me.uk>
Injection-Date: Fri, 29 Sep 2023 21:10:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="9e1006e7e6dc0fa76ee7501856baeedd";
logging-data="492370"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gMbeqx6z2JfEPPiYX/fae"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:RNHP50XXlM0lHt4qP4X9LVnTQxI=
 by: Mike Sanders - Fri, 29 Sep 2023 21:10 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> Is this just fun side project or are real data going to be involved?

In my case, there is separation of user space & script space.
In other words, httpd with 'awk' as a registered file type,
sits between script & sally:

https://example.io/foo.awk?name=sally?x=1?y=2

Nevertheless if you're thinking what I suspect, you'd be right.

--
:wq
Mike Sanders

Re: mHash for awk

<uf8fe8$o51p$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Sat, 30 Sep 2023 08:32:39 +0200
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <uf8fe8$o51p$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
<87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me>
<uf4v2v$3st7b$1@dont-email.me> <uf4vc5$3t09e$1@dont-email.me>
<uf556m$3u0nf$1@dont-email.me> <uf55j0$3u3ff$1@dont-email.me>
<uf76tn$dj02$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Sep 2023 06:32:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e01432b515b9b1f082548413e94b8146";
logging-data="791609"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++6+o+rQzSaBFg78HDbjmM"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:4W3vifRd5MT0bnIkHcMWsJfXjg4=
In-Reply-To: <uf76tn$dj02$1@dont-email.me>
X-Enigmail-Draft-Status: N1110
 by: Janis Papanagnou - Sat, 30 Sep 2023 06:32 UTC

On 29.09.2023 21:01, Mike Sanders wrote:
>
> [...] I like system() as its intrinsic to most every awk.

The problem with it is that it's a primitive interface; while
system() per se is ubiquitous in Awk everything you specify as
command(s) in it is system dependent (and thus non-portable).
Personally I avoid it. If I'd have a lot of system() commands
in my Awk code I'd infer that I probably should use the shell
instead (and embed Awk code in shell for specific tasks). And,
further, if there's a lot of shell and a lot of Awk functions
necessary it may be an indication that you need something else
that more thoroughly integrates shell with Awk text processing
functions. GNU Awk's extension libraries may provide some more
system specific functions, and while these are of course also
non-portable you can at least stay withing one (Awk-)tool.
The system() feature allows effectively just to fire up some
command(s) and forget them; no return code, no data exchange,
nothing. E.g.

$ awk 'BEGIN{system("true")}' ; echo $?
0 $ awk 'BEGIN{system("false")}' ; echo $?
0

For your (simple but not well supported) task of redirection
of error messages there might also be other approaches; e.g.
writing error messages into a log-file and displaying these
messages through another process.

awk '{ print "Error:", $0 >> "error.log" ; ... }'
# And in an own window:
tail -f error.log
# This is Unix (maybe DOS supports something similar?)

(Of course I can't tell whether it fits in your context.)

Janis

Re: mHash for awk

<uf8kae$ou50$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Sat, 30 Sep 2023 09:55:57 +0200
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uf8kae$ou50$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me>
<87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me>
<uf4v2v$3st7b$1@dont-email.me> <uf4vc5$3t09e$1@dont-email.me>
<uf556m$3u0nf$1@dont-email.me> <uf55j0$3u3ff$1@dont-email.me>
<uf76tn$dj02$1@dont-email.me> <uf8fe8$o51p$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Sep 2023 07:55:58 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e01432b515b9b1f082548413e94b8146";
logging-data="817312"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gZb6rlyrTiCy4zL1r+Bo7"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:/k9AM2JkYnlmxdt1C5HCcmTJs14=
In-Reply-To: <uf8fe8$o51p$1@dont-email.me>
 by: Janis Papanagnou - Sat, 30 Sep 2023 07:55 UTC

On 30.09.2023 08:32, Janis Papanagnou wrote:
>
> $ awk 'BEGIN{system("true")}' ; echo $?
> 0
> $ awk 'BEGIN{system("false")}' ; echo $?
> 0

Just noticed, I was wrong on that...

$ awk 'BEGIN{exit(system("true"))}' ; echo $?
0 $ awk 'BEGIN{exit(system("false"))}' ; echo $?
1

Janis

Re: mHash for awk

<uf91bc$ra8l$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: porkc...@invalid.foo (Mike Sanders)
Newsgroups: comp.lang.awk
Subject: Re: mHash for awk
Date: Sat, 30 Sep 2023 11:38:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 71
Sender: Mike Sanders <busybox@sdf.org>
Message-ID: <uf91bc$ra8l$1@dont-email.me>
References: <uf0247$2p33k$1@dont-email.me> <uf30ij$3hmge$1@dont-email.me> <87v8bueakh.fsf@bsb.me.uk> <uf4uin$3sqjv$1@dont-email.me> <uf4v2v$3st7b$1@dont-email.me> <uf4vc5$3t09e$1@dont-email.me> <uf556m$3u0nf$1@dont-email.me> <uf55j0$3u3ff$1@dont-email.me> <uf76tn$dj02$1@dont-email.me> <uf8fe8$o51p$1@dont-email.me> <uf8kae$ou50$1@dont-email.me>
Injection-Date: Sat, 30 Sep 2023 11:38:20 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="71610f329c6268ecc4cc1c9787d75a5d";
logging-data="895253"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+hLkZonBHpQ5Sf2WfxgE2"
User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (NetBSD/9.3 (amd64))
Cancel-Lock: sha1:eX7eyHV5u87VjzNLy6d0Dd1ltng=
 by: Mike Sanders - Sat, 30 Sep 2023 11:38 UTC

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

> $ awk 'BEGIN{exit(system("true"))}' ; echo $?
> 0
> $ awk 'BEGIN{exit(system("false"))}' ; echo $?
> 1

Nice, short & sweet, perfect.

My notes below (so far).

hit or miss here, mawk under win is not happy...

win output to stderr: echo This is an error message 1>&2

win busybox awk:

echo | busybox awk '{system("echo stderr message 1>&2")}' 2> err.txt

type err.txt
stderr message

win mawk:

echo | mawk "{system('echo stderr message 1>&2')}"
mawk: could not create a new process (Function not implemented)

notes:

both '&&' and '||' both work in win as we know in nix
nix $SHELL statement separator: ;

win %COMSPEC% statement separator: &

no true/false commands under win, but...

/*

gcc mFalse.c -o mFalse

mFalse
echo %ERRORLEVEL%

*/

int main(void) {return 1;}

// eof

/*

gcc mTrue.c -o mTrue

mTrue
echo %ERRORLEVEL%

*/

int main(void) {return 0;}

// eof

Only speaking for myself, but interesting stuff =)

--
:wq
Mike Sanders

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor