help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: here document within $()


From: Chet Ramey
Subject: Re: here document within $()
Date: Thu, 8 Oct 2026 15:14:24 -0400
User-agent: Mozilla Thunderbird

On 10/8/26 2:40 PM, Alejandro Colomar wrote:

I've been experimenting with other forms:

This seems to work:

        cat <<-'__EOF__' |
                echo foo;
        __EOF__
        eval "$(sed s/foo/bar/)";

Is the above correct?  Or am I abusing any accidents here?

It's not the clearest code ever written, but it will work.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]