title: Launch shell script on login in Mac OS (OS X)
body: <p>I have this shell script <code>Test.sh</code>:</p>
  
  <pre><code>#! /bin/bash
  
  FILE_TO_CHECK="/Users/test/start.txt"
  EXIT=0
  
  while [ $EXIT -eq 0 ]; do
      if [ -f "$FILE_TO_CHECK" ]
          then
          /usr/bin/java -jar myapp.jar
          EXIT=1
      else
          sleep 30
      fi
  done
  </code></pre>
  
  <p>I need to start this script automatically after login.<br>
  So I put it inside a folder <code>Test</code> in <code>/System/Library/StartupItems/</code></p>
  
  <p>When I reboot the Mac, nothing happens after I log in.
  Any clue?</p>
  
  <p>I also tried <code>Automator</code>, but with the same result: the java program is not running.</p>