You may want to play with example 9.6 on this webpage tutorial.
It explains the difference between "$*" and "$@".
http://www.tldp.org/LDP/abs/html/int...es.html#APPREF
The argument separation characters are defined by the $IFS variable which you can change in your script. Also the "$*" argument refers to the entire argument list as an entire word, starting with the command itself.
Your best bet is to be consistent with all other commands and either quote the argument, or escape the space with a backslash when entering the argument.
Also, put quotes around variables in scripts that expand into filenames.
for example in this line
for file in *.JPG; do mv "${file}" "${file%.JPG}.jpg"; done
the quotes are necessary around ${file} if a file might possible contain a separation character.