title: bash script - unable to set variable with double quotes in value
body: <p>Need help in fixing this bash script to set a variable with a value including double quotes. Somehow I am defining this incorrectly as my values <code>foo</code> and <code>bar</code> are not enclosed in double quotes as needed.</p>
  
  <p>My script thus far:</p>
  
  <pre><code>#!/usr/local/bin/bash
  set -e
  set -x
  
  host='127.0.0.1'
  db='mydev'
  _account="foo"
  _profile="bar"
  _version=$1
  _mongo=$(which mongo);
  
  exp="db.profile_versions_20170420.find({account:${_account}, profile:${_profile}, version:${_version}}).pretty();";
  ${_mongo} ${host}/${db} --eval "$exp"
  
  set +x
  </code></pre>
  
  <p>Output shows:</p>
  
  <pre><code>+ host=127.0.0.1
  + db=mydev
  + _account=foo
  + _profile=bar
  + _version=201704112004
  ++ which mongo
  + _mongo=/usr/local/bin/mongo
  + exp='db.profile_versions_20170420.find({account:foo, profile:bar, version:201704112004}).pretty();'
  + /usr/local/bin/mongo 127.0.0.1/mydev --eval 'db.profile_versions_20170420.find({account:foo, profile:bar, version:201704112004}).pretty();'
  MongoDB shell version: 3.2.4
  connecting to: 127.0.0.1/mydev
  2017-04-22T15:32:55.012-0700 E QUERY    [thread1] ReferenceError: foo is not defined :
  @(shell eval):1:36
  </code></pre>
  
  <p>What i need is <code>account:"foo"</code>, <code>profile:"bar"</code> to be enclosed in double quotes.  </p>