How to use application environment variables in your Script

You might want to load an app's environment variables in your script. Here's how to do it

Written by Chris Oliver
Updated 8 months ago
To load an application's environment variables in a Script, you can change into the app's current directory and then eval the output of asdf vars. This will load all the environment variables for your app for use in your script.

cd /home/deploy/MYAPP/current
eval "$(/home/deploy/.asdf/bin/asdf vars)"

Got a second, tell us how did we do?