title: Bash string handling (char at index and concatenation)
body: <p>I'm trying to learn bash string handling.
  How do I create a bash script which is equivalent to this Java code snippet?</p>
  
  <pre><code>String symbols = "abcdefg12345_";
  for (char i : symbols.toCharArray()) {
      for (char j : symbols.toCharArray()) {
          System.out.println(new StringBuffer().append(i).append(j));
      }
  }
  </code></pre>
  
  <p>The output of the above code snippet starts with:</p>
  
  <pre><code>aa
  ab
  ac
  ad
  ae
  af
  </code></pre>
  
  <p>And ends with:</p>
  
  <pre><code>_g
  _1
  _2
  _3
  _4
  _5
  __
  </code></pre>
  
  <p>My goal is to have a list of allowed characters (not necessarily the ones above) and print out all the permutations of length 2. If it is possible I would like a solution which relies solely on bash and doesn't require anything else installed.</p>
  
  <p><strong>Edit:</strong> Just a little follow up question: Is there a way to do this with a string without spaces separating sub-strings? Like LIST="abcdef12345_"?</p>