Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"There is no distinctly American criminal class except Congress." -- Mark Twain


devel / comp.unix.shell / Re: Bash ${!word} computed variable syntax.

SubjectAuthor
* Bash ${!word} computed variable syntax.Kaz Kylheku
+- Bash ${!word} computed variable syntax.David W. Hodgins
+- Bash ${!word} computed variable syntax.Kenny McCormack
+* Bash ${!word} computed variable syntax.Javier
|+* Bash ${!word} computed variable syntax.Christian Weisgerber
||`- Bash ${!word} computed variable syntax.Kaz Kylheku
|+* Bash ${!word} computed variable syntax.Kaz Kylheku
||+* Bash ${!word} computed variable syntax.Janis Papanagnou
|||+- Bash ${!word} computed variable syntax.Kaz Kylheku
|||+* Bash ${!word} computed variable syntax.Javier
||||`* Bash ${!word} computed variable syntax.Janis Papanagnou
|||| `- Bash ${!word} computed variable syntax.Javier
|||`* Bash ${!word} computed variable syntax.Javier
||| `- Bash ${!word} computed variable syntax.Kaz Kylheku
||+* Bash ${!word} computed variable syntax.Javier
|||`* Bash ${!word} computed variable syntax.Kaz Kylheku
||| +* Bash ${!word} computed variable syntax.Janis Papanagnou
||| |`- Bash ${!word} computed variable syntax.Kaz Kylheku
||| `- Bash ${!word} computed variable syntax.Javier
||`- Bash ${!word} computed variable syntax.Keith Thompson
|`* ksh indirection [was: Bash ${!word} computed variable syntax]Martijn Dekker
| +* ksh indirection [was: Bash ${!word} computed variable syntax]Kaz Kylheku
| |`- ksh indirection [was: Bash ${!word} computed variable syntax]Janis Papanagnou
| `- ksh indirection [was: Bash ${!word} computed variable syntax]Javier
`* Bash ${!word} computed variable syntax.Keith Thompson
 `* Bash ${!word} computed variable syntax.Kaz Kylheku
  `- Bash ${!word} computed variable syntax.Javier

Pages:12
Re: ksh indirection [was: Bash ${!word} computed variable syntax]

<P0-dnWUOv8OWjBj5nZ2dnZfqn_adnZ2d@brightview.co.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6360&group=comp.unix.shell#6360

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 11 Jun 2023 00:10:51 +0000
From: invalid@invalid.invalid (Javier)
Subject: Re: ksh indirection [was: Bash ${!word} computed variable syntax]
Newsgroups: comp.unix.shell
References: <20230605202611.371@kylheku.com> <D_6cnVNjRel7Ux35nZ2dnZfqnPudnZ2d@brightview.co.uk> <keevnaF3ekdU1@mid.individual.net>
Message-ID: <P0-dnWUOv8OWjBj5nZ2dnZfqn_adnZ2d@brightview.co.uk>
Date: Sun, 11 Jun 2023 00:10:51 +0000
Lines: 18
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-ZT0pfyBFQRemLjo7nOWVOSra3vSYK2Ezvo6wKs/aIqej6sXUV1OuPDAdS8UykRVVJjxGJ0welJ6mCSF!+fufAWle/+QFtBPXjGGJ9prHymtLMh6fmcI0nax6eJzMdXyglYmxbqiTdJgT5uWnqolcyHkkwjFL!5ko1Y0uD6XsXOrXT7o4q0TLx010=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Javier - Sun, 11 Jun 2023 00:10 UTC

Martijn Dekker <martijn@inlv.demon.nl> wrote:
> Op 07-06-2023 om 19:39 schreef Javier:
>> BTW, does anybody know why the shell does not allow the nested
>> brace syntax ${${variable}} for indirect variable reference?
>
> The abandoned 93v- beta of AT&T ksh93 (and hence also the derived and
> equally abandoned AT&T ksh2020 project) supported a ${$variable} syntax
> for indirection, though nested braces are a syntax error.
>
> I've found multiple bugs in their implementation of it

From your response I see that somebody already tried to implement the
feature in ksh. And it seems like the reason for abandoning it was to
keep the parser implementation simple (which I am in favor of).

One question: do shells use an intermediate bytecode compilation step
as in lisp/python/perl? I'm guessing that might be one of the reasons
for shells to keep very simple syntax rules.

Re: Bash ${!word} computed variable syntax.

<8mCdnYInYYDHgRT5nZ2dnZfqn_udnZ2d@brightview.co.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6386&group=comp.unix.shell#6386

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!69.80.99.26.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 14 Jun 2023 01:48:10 +0000
From: invalid@invalid.invalid (Javier)
Subject: Re: Bash ${!word} computed variable syntax.
Newsgroups: comp.unix.shell
References: <20230605202611.371@kylheku.com> <87legtiy3d.fsf@nosuchdomain.example.com> <20230608181715.460@kylheku.com>
Message-ID: <8mCdnYInYYDHgRT5nZ2dnZfqn_udnZ2d@brightview.co.uk>
Date: Wed, 14 Jun 2023 01:48:10 +0000
Lines: 26
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-z3DLOx1bjglCJt3rpGis3NcSYFZ057jWejKIbUYBsLc4gl+0efRRvMaG4u0vqFCVc58FIuvQ2RikmsY!RxuzK6u6CgnGFpUsrekMKYd34/+DoM1b/FaeT5jysN8YUBVto8PUOAp1SAEUP0ns5MPyzeTi/zkc!i/7TwvwvNxLpbenyqKtB9+HOg/4=
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Javier - Wed, 14 Jun 2023 01:48 UTC

Kaz Kylheku <864-117-4973@kylheku.com> wrote:
> The obvious question there is, how late is the binding?

Apparently the nameref feature works differently in ksh and bash.
I found this old message in the bash mailing list:

Chet Ramey <chet.ramey@case.edu>
Date: Sat, 15 Dec 2012 22:58:22
Newsgroups: gnu.bash.bug
Subject: Re: Requesting an alternate nameref feature

On 12/12/12 1:04 PM, Dan Douglas wrote:

> Hello. Could we possibly modify or create an additional variant of
> "typeset -n" which produces "real" references rather than just
> dynamic references by name? In other words, I'd like to be able
> to create reference variables that always point to the instance of
> a variable that was visible at the time the reference was created,
> similar to the way ksh93's nameref works.

This is the `pointer' implementation, as opposed to the `symbolic link'
implementation I chose.

The problem is the same as any use of pointers: what happens when the
object you point to goes out of scope? Or would you restrict it, like
declare -g, to only use the global scope?

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor