title: Saving a file name as a variable
body: <p>I need a way to save the name of a file into a variable, so that after I delete that file, I can create a new file with the same name as the original. How can I do that? </p>
  
  <p>for example, I take in a file and store it as var1 and another as var2 using</p>
  
  <pre><code>file=$var1
  file=$var2
  </code></pre>
  
  <p>later in my code, I need to delete var2 and create a link to var1 with the same name as the original var2. The command:</p>
  
  <pre><code>rm var2
  ln var1 var2 
  </code></pre>
  
  <p>creates an error message
  I think I need to create a temporary variable that holds just the name of the file var2, but I'm not sure how to do that. Any ideas? Thanks!</p>