<p>Hi I am having a shell script with name test.sh.It takes two arguments --a --b.I want to execute it using kubectl exec</p>
<p>I am currently following kubectl exec pod-name -- path-to-shell-file  [&quot;Arguments&quot;]</p>
<p>If i try it without the arguments the shell is working fine.</p>
<p>But this is not working.</p>
<p>Can you guys help me out.</p>

Sabarinathan
<p>I think <code>kubectl exec pod-name -- shell-bin shell-script-path --a --b</code> should work. For example <code>kubectl exec pod-name -- /bin/bash /path_to/test.sh --a --b</code>. What is the error you are getting?</p>
<p><strong>EDIT</strong></p>
<p>Adding a working example</p>
<pre><code> ~ $ kubectl exec nginx-deployment-7c8f47687f-b5qmw -- cat /test.sh
echo The arguments for test.sh are $@

 ~ $ kubectl exec nginx-deployment-7c8f47687f-b5qmw -- /bin/bash /test.sh --a --b
The arguments for test.sh are --a --b
</code></pre>
