[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comments inside command subst are handled inconsistently
From: |
G. Branden Robinson |
Subject: |
Re: comments inside command subst are handled inconsistently |
Date: |
Mon, 31 Jul 2023 07:22:42 -0500 |
Hi Denys,
At 2023-07-31T13:38:00+0200, Denys Vlasenko wrote:
> On 7/28/23 19:51, Martin D Kealey wrote:
> > On the other hand, since everyone has now had 36+ years to update
> > their scripts to get rid of backticks,
>
> I don't know about others, but I missed the memo that `` is
> deprecated.
The definitive "takedown" of `` is in Tom Duff's memo describing his
"rc" shell, which dates back to 1988-1991 or thereabouts. (I wish I
could put a more precise date on it.)[1]
I'm attaching a copy for your edification. Any use of a Bourne-derived
shell should read it and consider its points.
> The "function" keyword, for example. Why does it even exists? It adds
> no functionality. When you use it, the only effect you get is that now
> your script requires bash to work properly.
>
> (searching the net... looks like it's historic, added for
> compatibility with ksh).
Yes. It'd be a better world if both `` quoting _and_ the "function"
keyword were retired.
Regards,
Branden
[1] It's possible Steve Bourne knew better but was pressured into
implementing the lexically simpler `` approach to command
substitution instead of recursively calling the parser (as Chet
pointed out) because it would be more performant. John Mashey, the
author of the predecessor Unix shell (and successor to Ken
Thompson's original Unix shell) has gone on record as "goading"
Bourne into doing questionable things in the quest for speed.
https://www.in-ulm.de/~mascheck/bourne/segv.html
rc_A Shell for Plan 9 and Unix Systems_Duff.pdf
Description: rc_shell_tom_duff.pdf
signature.asc
Description: PGP signature
- comments inside command subst are handled inconsistently, Denys Vlasenko, 2023/07/27
- Re: comments inside command subst are handled inconsistently, Denys Vlasenko, 2023/07/31
- Re: comments inside command subst are handled inconsistently, Chet Ramey, 2023/07/31
- Re: comments inside command subst are handled inconsistently, Denys Vlasenko, 2023/07/31
- Re: comments inside command subst are handled inconsistently, G. Branden Robinson, 2023/07/31
Re: comments inside command subst are handled inconsistently, Chet Ramey, 2023/07/29