title: bash redirecting EOF into variable
body: <p>this is my file perl5lib.sh:</p>
  <pre><code>export PERL5LIB=`cat |tr '\n' ':'`&lt;&lt;EOF
  /home/vul/repository/projects/implatform/daemon/trunk/lib/
  /home/vul/repository/projects/platformlib/tool/trunk/cpan_lib
  /home/projects/libtrololo
  </code></pre>
  <p>I want to start file as</p>
  <pre><code>. perl5lib.sh
  </code></pre>
  <p>to populate <code>PERL5LIB</code> variable, but it hangs. What is wrong?
  my goal is to left folder names at the end of file, so I can add new simply:</p>
  <pre><code>echo dirname &gt;&gt; myscript
  </code></pre>
  <p>I have tried and <code>export PERL5LIB=$(echo blabla)</code> and <code>cat&lt;&lt;EOF</code> both work separately, but not together.</p>
  <p>=================== THE SOLUTION ============================</p>
  <h1>function do the trick!</h1>
  <pre><code>function fun
  {
       export PERL5LIB=`cat|tr '\n' ':'`
  }
  fun&lt;&lt;EOF
  /dir1/lib
  /dir2/lib
  /dir3/lib
  EOF
  </code></pre>