Execute Shell Scrip individually for each selected file in Finder

Use a shell script such as the following that will run the command each time for each of the arguments:

for f in "$@"
do
  open "http://www.google.com/search?q=$f"
done