help-bash
[Top][All Lists]
Advanced

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

Re: here document within $()


From: Greg Wooledge
Subject: Re: here document within $()
Date: Wed, 7 Oct 2026 08:26:30 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Oct 07, 2026 at 09:51:01 +0200, Alejandro Colomar wrote:
> I'm trying to have a here document used within $() which itself is
> passed to eval(1).

*Shudder*

> Here's a minimal example of what I want:
> 
>       eval $(cat <<'__EOF__');
>       echo foo;
>       __EOF__

The closing parenthesis has to be after the __EOF__, on a new line.

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

I have *no idea* how eval is going to interact with all that, so it's
all on you.



reply via email to

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