Groovy
get env vars: http://www.mytechtoday.com/2009/01/read-environment-variables-with-groovy.html
def env = System.getenv()
println env['HOME']
executing complex shell: http://www.joergm.com/2010/09/executing-shell-commands-in-groovy/
https://gist.github.com/kaltepeter/e5cbe4b7c1ec3e0f2ea4c54f93ee520a for example
chaining closures
http://mrhaki.blogspot.com/2011/04/groovy-goodness-chain-closures-together.html