title: for loop in remote host is not working - shell script
body: <pre><code>ssh $hname "cd /opt/tomcat/webapps/aware/WEB-INF/classes/com &amp;&amp; for FNAME in `tar tvf /tmp/prop.tar | awk '{print $6}'` 
  do
    if test ! -s "/tmp/$fname/prop_bkup.tar"
    then
      ls $FNAME &amp;&amp; tar cvf /tmp/$fname/prop_bkup.tar $FNAME &amp;&amp; rm $FNAME || echo "$FNAME is a new file".
    else
      ls $FNAME &amp;&amp; tar uvf /tmp/$fname/prop_bkup.tar $FNAME &amp;&amp; rm $FNAME || echo "$FNAME is a new file".
    fi
  done"
  </code></pre>
  
  <p>Above for loop is not working in remote host. Can anyone please help me on this?</p>