title: Can't access fresh generated temp directory in bash script on macOS
body: <p>I'm enhancing my .bash_profile with this script. It extracts an .ipa and shows me the provisioning profile information. The .ipa file gets extracted to a temporary directory.</p>
  
  <pre><code>function prov() {
      myTmpDir=`mktemp -d 2&gt;/dev/null || mktemp -d -t 'myTmpDir'`
      unzip -q "$1" -d "${myTmpDir}";
      pathToFile="${myTmpDir}/Payload/*.app/embedded.mobileprovision"
      security cms -D -i "${pathToFile}"
  }
  </code></pre>
  
  <p>The problem is that <code>security cms</code> can't access the extracted files in the script:</p>
  
  <pre><code>mles-MacBook-Pro:2015 mles$ prov gfhZH_v4.7.0_20161222_1544.ipa 
  security: unable to open "/var/folders/vc/rmwcd9014fx1__syr239k1740000gn/T/tmp.CrAJbnwj/Payload/*.app/embedded.mobileprovision" for reading: No such file or directory
  </code></pre>
  
  <p>However accesing it by hand works:</p>
  
  <pre><code>mles-MacBook-Pro:2015 mles$ ls /var/folders/vc/rmwcd9014fx1__syr239k1740000gn/T/tmp.CrAJbnwj/Payload/*.app/embedded.mobileprovision
  /var/folders/vc/rmwcd9014fx1__syr239k1740000gn/T/tmp.CrAJbnwj/Payload/fsg4zh.app/embedded.mobileprovision
  </code></pre>
  
  <p>Running <code>security cms -D -i</code> by hand also works</p>
  
  <pre><code>mles-MacBook-Pro:2015 mles$ security cms -D -i /var/folders/vc/rmwcd9014fx1__syr239k1740000gn/T/tmp.CrAJbnwj/Payload/*.app/embedded.mobileprovision
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  ...
  </code></pre>
  
  <p>Why is this not possible in the shell script? </p>