The last example<p><pre><code> $ kubectl apply -f <(cat << EOF
…
EOF
)
</code></pre>
can be written<p><pre><code> $ kubectl apply -f- <<EOF # ...
</code></pre>
Piping from cat is a pretty big red flag that you are doing whatever you are doing in a roundabout way.
There's also these resources for more vetted patterns:<p>(1) Bash: <a href="https://github.com/dylanaraps/pure-bash-bible" rel="nofollow">https://github.com/dylanaraps/pure-bash-bible</a><p>(2) POSIX Shell: <a href="https://github.com/dylanaraps/pure-sh-bible" rel="nofollow">https://github.com/dylanaraps/pure-sh-bible</a>