title: BASH - curl command not work into loop with for
body: <p>i need check status of some link listen in a file called <code>paths.txt</code>, i have write a simple <code>for</code> loop but not work</p>
  
  <pre><code>for LINK in $(cat paths.txt)
  do
    CURL="$(curl -I $LINK 2&gt;/dev/null | head -n 1 | cut -d$' ' -f2)"
    if [ "${CURL}" = "200" ]
    then
      echo ${LINK} &gt;&gt; true.txt
    else
      echo ${LINK} &gt;&gt; false.txt
    fi
  done
  </code></pre>
  
  <p>If i launch the <code>curl</code> command from terminal i read the right status, instead if i make an echo of <code>CURL</code> variable i not have any output</p>