<p>I'm trying to run the following command:</p>
<p><code>kubectl exec vault-1 -- vault operator raft join -leader-ca-cert=`cat &quot;$VAULT_CACERT&quot;` https://vault-0.vault-internal:8200</code></p>
<p>The goal here is to get the contents of the cert file at the path stored in $VAULT_CACERT (variable on the pod) and pass that in as the -leader-ca-cert using kubectl.  When I run I get <code> cat: '': No such file or directory</code> which seems to indicate is possibly using my local machines env.  Connecting to the pod and running the command that way does work.</p>
<p>I've tried a few different commands and I can seem to find a way to achieve what I want through kubectl.  Is there a better way to pass this data in somehow?</p>

DoubleHolo
<p>If the <code>ENV</code> is inside the container, then you should not use backtick in the exec command. Use single quotes to avoid shell expansion on your local machine terminal.
so you can try something like below</p>
<pre><code>kubectl exec vault-1 -- vault operator raft join -leader-ca-cert='cat &quot;$VAULT_CACERT&quot;' https://vault-0.vault-internal:8200
</code></pre>
<p>I tested out something like below and it seems working for me</p>
<pre><code>kubectl exec demo -- sh -c 'cat &quot;$FILE_PATH&quot;'
</code></pre>
