title: Shell Script: Copying files with wildcard (*) to from one folder to another folder
body: <p>A very simple question but bothers me. I want to copy all files in one folder to another folder in a shell script. Like this:</p>
  
  <pre><code>#!/bin/sh
  cp data/* /tmp/data
  </code></pre>
  
  <p>But got <code>error: zsh:1: no matches found: data/*</code></p>
  
  <p>Reading various posts on stackoverflow, like here: <a href="https://stackoverflow.com/questions/21924351/copying-files-with-wildcard-to-a-folder-in-a-bash-script-why-isnt-it-work">Copying files with wildcard (*) to a folder in a bash script - why isn&#39;t it working?</a>
  I have tried:</p>
  
  <pre><code>cp "data"/* /tmp/data
  Error: zsh:1: no matches found: data/*
  cp -r data /tmp/data
  Error cp: cannot stat `data': No such file or directory
  </code></pre>
  
  <p>I could verify data folder contains files, and I'm in the parent directory data folder. If I do <code>ls data</code> in the script, the contents of it are correctly printed.</p>
  
  <p>Could anyone help? I'm using zsh.</p>