title: Retrieving a list of records from a file and add them to a variable list
body: <p>I want to:</p>
  <ol>
  <li><p>Provide a list of certain folders (starting with MG) in a certain path and write this list into a .txt file</p>
  <pre><code>ls | grep MG*.* &gt; tempfile.txt
  </code></pre>
  <p>File.txt contents should be:</p>
  <pre class="lang-none prettyprint-override"><code>MG-x###1 
  MG-x###2 
  MG-x###3
  </code></pre>
  </li>
  <li><p>Read the .txt file and take the name of the folders and make them items as part of a list</p>
  <pre><code>listvariables=&quot;MG-x###1 MG-x###2 MG-x###3&quot;
  </code></pre>
  </li>
  </ol>