On 8/29/25 7:15 AM, Kevin Pulo wrote:
On Fri, 29 Aug 2025 at 01:00, Koichi Murase <[email protected]> wrote:

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.

I like this alternative. I considered $`command` but with no nofork
variant, but that might already exist in some script somewhere to
construct a variable name to be supplied to eval or similar.

I'm not wild about the choice of `;' but I don't think it's appreciably
worse than something like `${+cmd;}', other than being visually jarring.
Anyone else have candidates for the command character?

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to