Pass the needed environment variables to the script as script's arguments.

This makes it much easier to print the set of variables that have been passed to the script.

Thanks @huitseeker for the great tip!