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: Wed, 7 Oct 2026 09:04:47 -0400
User-agent: Mozilla Thunderbird

On 10/7/26 3:51 AM, Alejandro Colomar wrote:
Hi!

I'm trying to have a here document used within $() which itself is
passed to eval(1).

Here's a minimal example of what I want:

        eval $(cat <<'__EOF__');
        echo foo;
        __EOF__

If you want to use a here-document in a command substitution, the entire
here-document has to appear within the command substitution.

Chet

--
``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]