title: How can i make python program to get executed in a loop in bash script?
body: <p>I have a  bash script where to execute the python program within  a loop as below. I see only once its getting executed with the below script. The echo statement prints all the filenames in the directory within the loop, whereas the pgm1.py executes only once. Kindly advice what i have to do it here to continuously getting executed for all the files with the directory.
  Here is the below code.</p>
  <pre class="lang-sh prettyprint-override"><code>LOG_DIR=&quot;directorypathname&quot;
  DT_H=`date '+%Y-%m-%d_%H_%M_%S'`
  linkage_path=&quot;directoryname&quot; 
  yourfilenames=`ls $linkage_path`
  
  for eachfile in $yourfilenames
  do
      python3.5 ${CODE_DIR}/pgm1.py ${linkage_path}/${eachfile}  &amp;&gt; ${LOG_DIR}/${DT_H}.log
      echo ${linkage_path}/${eachfile}
  done
  </code></pre>