title: Bash curl and variable in the middle of the url
body: <p>I would need to read certain data using curl. I'm basically reading keywords from file</p>
  
  <pre><code>while read line
  do
      curl 'https://gdata.youtube.com/feeds/api/users/'"${line}"'/subscriptions?v=2&amp;alt=json' \
           &gt; '/home/user/archive/'"$line"
  done &lt; textfile.txt
  </code></pre>
  
  <p>Anyway I haven't found a way to form the url to curl so it would work. I've tried like every possible single and double quoted versions. I've tried basically:</p>
  
  <pre><code>'...'"$line"'...'
  "..."${line}"..."
  '...'$line'...'
  </code></pre>
  
  <p>and so on.. Just name it and I'm pretty sure that I've tried it. </p>
  
  <p>When I'm printing out the URL in the best case it will be formed as:</p>
  
  <pre><code> /subscriptions?v=2&amp;alt=jsoneeds/api/users/KEYWORD FROM FILE
  </code></pre>
  
  <p>or something similar. If you know what could be the cause of this I would appreciate the information. Thanks!</p>