title: How does bash/scp expand out "remote" glob patterns?
body: <p>If I execute (in bash):</p>
  
  <pre><code>scp remote.machine:/var/log/sy* .
  </code></pre>
  
  <p>I get all the files which match /var/log/sy* on the <em>remote</em> machine.</p>
  
  <pre><code>syslog                                     100%   91KB  10.1KB/s   00:09    
  syslog.1                                   100%  753KB  62.7KB/s   00:12    
  syslog.2.gz                                100%   55KB   7.9KB/s   00:07    
  syslog.3.gz                                100%   50KB   8.3KB/s   00:06   
  </code></pre>
  
  <p>How can this work?</p>
  
  <p>I was under the impression that glob patterns were expanded by the shell <em>before</em> the command was executed.</p>
  
  <p>Is my understanding incorrect? </p>