title: Bash - Script to deploy and run jar files
body: <p>im working on distributed systems and my program is complete, i have tested it and it runs fine over 10 machines, but every time i want to test the program i have to:
  - Copy the file for each machine
  - ssh to each machine and type "java -jar file"</p>
  
  <p>To avoid that painfull process I made this</p>
  
  <pre><code>for i in {1..11}
  do
      if [ $i -ne 6 ]; 
      then
          sshpass -p "qwerty" scp myJar.jar user@l040101-ws$i.XXXX.XX.XX:someFolder;
          sshpass -p "qwerty" ssh user@l040101-ws$i.XXXX.XX.XX "java -jar someFolder/myJar.jar &amp;" &amp;
      fi
  done
  </code></pre>
  
  <p>And for some reason it doesnt work like it should, the scp command executes as it should, but the other one doesnt.</p>
  
  <p>The program should produce a folder with 2 logs inside and if i do it manually it does, so i guess is not permission problem, but not with the script.
  The weired thing is if i run top, i can see the java processes running in each machine.</p>
  
  <p>BTW: those 2 &amp; is so it the script doesnt get stuck after running each jar</p>