title: Generate all possible strings from a list of token
body: <p>I have a list of tokens, like:</p>
  
  <pre><code>hel
  lo
  bye
  </code></pre>
  
  <p>and i want to generate all the possible combinations of such strings, like:</p>
  
  <pre><code>hello
  lohel
  helbye
  byehel
  lobye
  byelo
  </code></pre>
  
  <p>Language is not important, any advice?</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/3846123/generating-permutations-using-bash">Generating permutations using bash</a>, but this makes permutation on a single line.</p>