Friday, January 30, 2009

Read Environment Variables with Groovy

Facebook

Environment variables can be easily accessed with Groovy with getenv() method as shown below.


def env = System.getenv()
//Print all the environment variables.

env.each{
println it
}
// You can also access the specific variable, say 'username', as show below
String user= env['USERNAME']

0 comments:

Post a Comment

I love to entertain onymous user Comment !

Pages

 ©mytechtoday.com 2006-2010

 ©Mytechtoday

TOP