regarding the whitespace problem (unfortunately the shell uses lists separated by spaces for $@), you can find several solutions there: http://stackoverflow.com/questions/301039/how-to-escape-white-space-in-bash-loop-list
regarding the whitespace problem (unfortunately the shell uses lists separated by spaces for $@), you can find several solutions there: http://stackoverflow.com/questions/301039/how-to-escape-white-space-in-bash-loop-list