help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Bash syntax for using here-doc's or variables as files i


From: Jesse Hathaway
Subject: Re: [Help-bash] Bash syntax for using here-doc's or variables as files in process substitution
Date: Wed, 27 Jun 2018 09:35:59 -0500

Thanks, João

On Tue, Jun 26, 2018 at 1:54 PM, João Eiras <address@hidden> wrote:
> exec {fd}<<<"long string"
> some-command <&$fd
> some-command /dev/fd/$fd # < not entirely portable I think
> exec {fd}<&-

that definitely works:

printf -v bubbles 'bubbles'
exec {fd}<<<"${bubbles}"
cat <&$fd
exec {fd}<&-

exec {fd}<<-'EOF'
butter
EOF
cat <&$fd
exec {fd}<&-

I would love something that doesn't requiring managing file
descriptors, but this
is certainly a workable solution.



reply via email to

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