title: How to pass a bash variable to a "bazel 'set' query"
body: <p>I have the following set of files that I want to pass into Bazel using</p>
  <pre class="lang-sh prettyprint-override"><code>res=$(git diff --name-only ${COMMIT_HASH}^! | grep '^src/' | uniq | cut -d/ -f2-)
  # echo $res
  # services/service-a/README.md
  # services/service-a/main.go
  # ...
  bazel query --keep_going 'set(${res})'
  </code></pre>
  <p>But simply trying that results in:</p>
  <pre><code>bazel query --keep_going 'set(${res})'
  ERROR: Skipping '$': no such target '//:$': target '$' not declared in package '' defined by /Users/aoutadi/code/KeepTruckin/kt/src/BUILD.bazel
  ERROR: Skipping '{res': no such target '//:{res': target '{res' not declared in package '' defined by /Users/aoutadi/code/KeepTruckin/kt/src/BUILD.bazel
  ERROR: Skipping '}': no such target '//:}': target '}' not declared in package '' defined by /Users/aoutadi/code/KeepTruckin/kt/src/BUILD.bazel
  WARNING: --keep_going specified, ignoring errors. Results may be inaccurate
  INFO: Empty results
  </code></pre>
  <p>I know that it might be possible to embed my command into the bazel query itself using</p>
  <pre class="lang-sh prettyprint-override"><code>bazel query --keep_going 'set($(git diff --name-only ${COMMIT_HASH}^! | grep '^src/' | uniq | cut -d/ -f2-))'
  </code></pre>
  <p>but I would like to avoid this for clarity and instead use <code>$res</code>.</p>
  <p>Is this possible?</p>