Just today I made a suggestion in a Github issue[0] to use sed for a similar use case. There, it was to generate an Amazon ECS task definition file from a CI tool's environment variables. Using this, populating the list of environment variables by looping through the output of env and including anything that matches a given prefix would be a breeze.
Thanks for the excellent tool!
[0]: https://github.com/1science/wercker-aws-ecs/issues/4#issueco...