title: How to pass variable inside the ssh command inside for loop
body: <p>I have a VM where I have a folder <strong>A</strong> which contains <code>doc1.txt</code> <code>doc2.txt</code> <code>king1.so</code> and <code>king2.so</code><br />
  I am trying to list the files of a specific extension using <code>ssh</code> from another VM.</p>
  <pre><code>VAR_PATH=&quot;/predefined/path/to/A&quot;
  echo $VAR_PATH
  
  for file_path in `ssh user@xxx.xxx.xxx.xxx &quot;find $VAR_PATH -iname &quot;*.so&quot;&quot;`
  do
          echo $file_path
  done
  
  </code></pre>
  <p>This is not working and giving me error as</p>
  <blockquote>
  <p>find: paths must precede expression: sample.so
  Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]</p>
  </blockquote>
  <p>the same command works when I am <em><strong>hardcoding the path</strong></em> in <code>find</code> command</p>
  <pre><code>for file_path in `ssh user@xxx.xxx.xxx.xxx &quot;find /predefined/path/to/A -iname &quot;*.so&quot;&quot;`
  do
          echo $file_path
  done
  
  </code></pre>
  <p>How do I pass path variable inside the ssh command inside this for loop</p>