title: Bash script - perform grep on filenames containing particular numbers
body: <p>I have a bunch of files such as:</p>
  
  <pre><code>jobReports/NARX_20191212_1.out
  jobReports/NARX_20191212_10.out
  jobReports/NARX_20197695_2.out
  jobReports/NARX_20197695_3.out
  jobReports/NARX_20261798_1.out
  </code></pre>
  
  <p>where the first numeral sequence denotes a jobID, and the second numeral sequence denotes the arrayID.</p>
  
  <p>I want to perform a search on all the <code>.out</code> files in that directory with jobID equal to <code>20197695</code> or <code>20261798</code>.</p>
  
  <p>In the command line, this works:</p>
  
  <pre><code>grep "Saving results to" jobReports/NARX_{20197695,20261798}*.out | wc -l
  </code></pre>
  
  <p>, which gives me a count of occurences of that string in the desired files. In my script I have the following:</p>
  
  <pre><code>#!/bin/bash
  myJobs = ( 20197695, 20261798 )
  IFS=, eval 'myJobs_string="${myJobs[*]}"'
  echo $(grep "Saving results to" jobReports/NARX_{$myJobs_string}*.out |wc -l)
  </code></pre>
  
  <p>when running, I get the error:</p>
  
  <pre><code>grep: jobReports/NARX_{: No such file or directory
  grep: 20197695: No such file or directory
  grep: }*.out: No such file or directory
  </code></pre>
  
  <p>So looks like inside the script, the brace expansion is not working as I expected...what can I do to fix this?</p>