Groovy web console

subscribe to the feed Subscribe
to this
site

Get environment variable with default

Published 6 months ago by Valentin
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def foo = System.getenv('FOO') ?: 'none'
println foo

def bar = System.getenv('USER') ?: 'none'
println bar