title: Bash find filename and set to variable
body: <p>I want to find the name of a file in a folder on my server and set it to a variable to use it later.  The problem is when I run my backup script the file name changes each time to compensate for the date.  So I cannot just hard code the file name and path.</p>
  
  <p>For example I know where the file will be - /var/backups/"unknownfilename.sql"</p>
  
  <pre><code> backuppath="/var/backups/"
  </code></pre>
  
  <p>How can I set $backupfile to the file in $backuppath?</p>
  
  <p>After researching I can only find where people echo out the filenames, they never end up storing them to a variable.</p>