title: Using bash, how do you make a classpath out of all files in a directory?
body: <p>This will be a <strong><em>really</em></strong> simple freebie for a bash guru:</p>
  
  <p><strong>Question</strong></p>
  
  <p>Using bash, how do you make a classpath out of all files in a directory?</p>
  
  <hr>
  
  <p><strong>Details</strong></p>
  
  <p>Given a directory:</p>
  
  <pre><code>LIB=/path/to/project/dir/lib
  </code></pre>
  
  <p>that contains nothing but *.jar files such as:</p>
  
  <pre><code>junit-4.8.1.jar
  jurt-3.2.1.jar
  log4j-1.2.16.jar
  mockito-all-1.8.5.jar
  </code></pre>
  
  <p>I need to create a colon-separated classpath variable in the form:</p>
  
  <pre><code>CLASSPATH=/path/to/project/dir/lib/junit-4.8.1.jar:/path/to/project/dir/lib/jurt-3.2.1.jar:/path/to/project/dir/lib/log4j-1.2.16.jar:/path/to/project/dir/lib/mockito-all-1.8.5.jar
  </code></pre>
  
  <p>Some seudo-code that nearly expresses the logic I'm looking for would be along the lines of:</p>
  
  <pre><code>for( each file in directory ) {
     classpath = classpath + ":" + LIB + file.name
  }
  </code></pre>
  
  <p>What is a <strong><em>simple</em></strong> way to accomplish this via bash script?</p>