title: How can I write a user assigned variable to a list of URLs in a text file?
body: <p>I have a text file containing a list of multiple urls <code>list.txt</code>. I am trying to add a variable to each of the search strings in this list so that a line like <code>https://www.google.com/search?q=</code> would be appended with the variable <code>"$v"</code> or its correct equivalent to look like <code>https://www.google.com/search?q="$v"</code>  </p>
  
  <p>My goal is to do something like the code below so that every time the script is executed the variable in <code>list.txt</code> can be redefined. But I can't seem to figure out how to make <code>"$v"</code> in <code>list.txt</code> be interpreted as the variable assigned by the user. </p>
  
  <pre><code>#!/bin/bash
  
  echo "Enter you query"
  read -p "" v
  
  cat list.txt | while read urls; do 
  lynx -dump -listonly -get_data "$urls"; done
  </code></pre>
  
  <p>Edit - It should be noted that for some of the urls in this list the search string is not at the end of the line. For example <code>http://example.com/?s="${v}"&amp;x=0&amp;y=0</code> where <code>"{v}"</code> is the variable I'm trying to place. </p>