>> If the feature is really desired by the community as an essential feature, it
>> should be implemented as a new syntax.

>I looked at adding alternate syntax for doing command substitution without
>stripping trailing newlines, and it turned out to be easier than I expected.

>This patch adds the syntax ${;cmd;}, which is handled identically to ${ cmd;}
>except that trailing newlines are preserved.

>It's only necessary to do a nofork version, because if someone deliberately
>wants to run inside a subshell (ie. fork instead of no-fork) then they can just
>do that explicitly with ${;(cmd;);}.

>I don't care much about the choice of character, ie. if something else would be
>better than ';'.  A single character is definitely easier to parse and handle
>than some of the fancier previous proposals, such as
>https://lists.gnu.org/archive/html/bug-bash/2021-01/msg00269.html which is very
>extensible, but would be a lot more work.
(rest snipped)

This does look like a better way to do it and it should silence your critics.

However, it does still leave the problem that whatever objections they have had 
to the
idea of doing it with "shopt" applies to pretty much most/all of the (other) 
"shopt"
options.  That is, most/all of the "shopt" options change shell behavior in 
ways that
can impact existing code and/or libraries.

This is why, despite the fact that a lot of the "shopt" options look 
interesting - and
basically correct for longstanding bugs^Wquirks in the shell language - I have 
shied
away from using "shopt" much.  Using them is going to basically require you to
re-analyze every bit of existing code, as well as, of course, any 
libraries/frameworks
that you are using.  It almost always ends up not being worth the trouble/risk.

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

When responding to my posts, please try to refrain from giving bureaucratic 
answers.
If you have nothing useful to say, then just click Next and go on.

Reply via email to