title: Prevent 'cp' from outputting the file name from a bash script
body: <p>I have a shell script which copies a few files to the current directory, compresses them, and streams the compressed file to stdout.</p>
  
  <p>On the client side I use plink to execute the script and stream stdin to a file.</p>
  
  <p>This almost works.</p>
  
  <p>It seems that the cp command outputs the file name being copied when its executed from inside the script. If I execute '<strong>cp /path/to/file1 .</strong>' in the shell it does it quietly; if I execute it in a script it outputs "file1".</p>
  
  <p>How do I prevent this? I've tried piping the output of the cp command to /dev/null and to a dummy text file but with no luck.</p>
  
  <p>thanks for any help.</p>
  
  <h3>the script</h3>
  
  <pre><code>#!/bin/bash
  
  cp /path/to/file1 .
  cp /path/to/file2 .
  cp /path/to/file3 .
  
  tar -cvzf package.tgz file1 file2 file3
  
  cat package.tgz
  </code></pre>
  
  <h3>the output</h3>
  
  <pre><code>file1
  file2
  file3
  &lt;&lt;binary data&gt;&gt;
  </code></pre>