Copying images to another directory using command line arguments bash
<p>I'm really new to bash and I'm trying to write a script to loop through all pictures in a directory and copy them individually to a different directory. I'm not really familiar with syntax, so I can't really figure out what I'm doing wrong.</p>

<pre><code>func ()
{
FILES=$1
FILES+=/*.jpg
for f in $FILES
do
   echo "$f"
   cp "$f" $2

done;
}
func $1 $2
</code></pre>

<p>If i enter arguments like
    <code>script ./images ./test</code> 
it echos every image as </p>

<pre><code>/images/image1.jpg
/images/image2.jpg
</code></pre>

<p>and so on, but it's not actually copying them to the test directory. Any ideas on what the problem could be?</p>