"cannot execute binary file" when trying to run a shell script on linux
<p>I am very new to linux and shell scriprting.
I am trying to run a shellscript from secure shell (ssh) on linux using following commands:</p>

<pre><code>chmod +x path/to/mynewshell.sh

sh path/to/mynewshell.sh
</code></pre>

<p>I get this error: </p>

<pre><code>path/to/mynewshell.sh: path/to/mynewshell.sh: cannot execute binary file.
</code></pre>

<p>Tried using this command: </p>

<pre><code>bash path/to/mynewshell.sh
</code></pre>

<p>I get the same error.</p>

<p>Tried with this command: <code>su - myusername sh path/to/mynewshell.sh</code>
It is asking for my password and giving me this error: <code>no such file or directory</code>.</p>

<p>1.The result of cat -v path/to/mynewshell.sh is:
^@^@^@^@^@^@^@^@Rscript "$dir"/diver_script.R
done</p>

<p>2.When tried 'less path/to/mynewshell.sh' i got this on my terminal:</p>

<pre><code>#!/bin/bash/Rscript^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
for dir in /path/to/* ; do 
^@^@^@^@^@^@^@^@Rscript "$dir"/myRscript.R
done
</code></pre>

<p>3.When i ran file path/to/mynewshell.sh : i got this "Bourne-Again shell script text executable"</p>

<p>Please give any advice on how I can try executing the shellscript.</p>