Shell script cp not working (but working in terminal) Mac os X
<p>I've been recently learning about shell scripting, and am stumped by a weird error:</p>

<p>My simple script (test.command):</p>

<pre><code>#!/bin/sh
clear
cd /Users/Stan/Desktop/testFolder
ls 
cp "earth.png lol.png"
read -p "Done, press ENTER to finish"
</code></pre>

<p>Whenever I run the script (double clicking the .command file), here is the output (copied from terminal window): </p>

<pre><code>earth.png
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
Copy was done...?
earth.png
Done, press ENTER to finish
</code></pre>

<p>The cp ALWAYS gives a 'usage' error, and WONT copy anything, but now if i manually run the SAME exact commands, in order in terminal (copy of terminal window):</p>

<pre><code>Stans-Mac-mini:testFolder Stan$ ls
earth.png
Stans-Mac-mini:testFolder Stan$ cp earth.png lol.png
Stans-Mac-mini:testFolder Stan$ ls
earth.png   lol.png
Stans-Mac-mini:testFolder Stan$ 
</code></pre>

<p>The file got copied without any error! Please help me fix this, I couldn't find any solutions online, help is greatly appreciated!</p>