Re:What I learned from others' shell scripts
by barrkel on Wednesday August 14, 2013 @12:59PM
(#6212693)
Free advice: you almost never want $. Almost always what you want is $@, usually in the form "$@". It doesn't matter for this example, but $ is usually a code smell.
TLDP's Advanced Bash-Scripting Guide is a great resource for learning bash.
For example, this section talks about the meaning of "$*":
http://www.tldp.org/LDP/abs/html/internalvariables.html#ARGL...