title: syntax error near unexpected token `do'
body: <p>I am trying to convert a .bat file into .sh file here is my lines of code</p>
  
  <pre><code>#!/bin/sh
  ./setenv.sh
  export _LIBJARS=for i in [$XYZ_HOME$/lib/*.jar];do source $XYZ_HOME$/bin/append.bat i
  export CLASSPATH=$ANT_HOME$/lib/ant.jar;$_LIBJARS$$ANT_HOME$/bin/ant -buildfile $XYZ_HOME$/build.xml $1 $2 $3 $4
  </code></pre>
  
  <p>After writing these line I wrote <code>chmod 755 ./build.sh</code>
  then I wrote <code>./build.sh test-deploy</code></p>
  
  <p>I am getting the following error:</p>
  
  <pre><code>./build.sh: line 3: syntax error near unexpected token `do'
  ./build.sh: line 3: `export _LIBJARS=for i in [$XYZ_HOME$/lib/*.jar];do source $XYZ_HOME$/bin/append.bat i'
  </code></pre>
  
  <p>My .Bat file is like </p>
  
  <pre><code>call setenv.bat
  
  set _LIBJARS=
  for %%i in (%XYZ_HOME%\lib\*.jar) do call %XYZ_HOME%\bin\append.bat %%i
  
  set CLASSPATH=%ANT_HOME%\lib\ant.jar;%_LIBJARS%
  
  %ANT_HOME%\bin\ant -buildfile %XYZ_HOME%\build.xml %1 %2 %3 %4
  </code></pre>
  
  <p>Or any tutorial to understand the lines of code or related to shell and bash file please suggest me.</p>