title: shell script while loop trigger build
body: <p>I have a requirement to trigger a build for some specific projects, which are seperated in a text file with comma. </p>
  
  <p>I wrote a shell script to split the contents of the file, extract the folder and navigate to that folder. Once navigation is done, trigger a build and this should happen for all project paths. The below script works fine if i do listing files in directory after navigation, but while doing a gradle build this executes only once.</p>
  
  <p>Below is my shell script</p>
  
  <pre><code>CWD="$(pwd)"
  INPUT=deploy.txt
  OLDIFS=$IFS
  IFS=","
  [ ! -f $INPUT ] &amp;&amp; { echo "$INPUT file not found"; exit 99; }
  while read f1
  do
    echo "$f1 building...";
    (
      cd $f1;
      gradle clean b u;
      cd $CWD;
  
     )
    echo "Build over"
  
  done &lt;  $INPUT
  IFS=$OLDIFS
  </code></pre>
  
  <p>Any issue with this script? Please help</p>