Re-using environment variables for paths

Is it possible to re-use previously-defined environment variables when setting other environment variables?

  - ROOT_PATH: "some/long/path/here"

We have a project that has a bunch of different paths that could be reused to simplify things, but we haven’t managed to get it working, and have had to hard-code every path.

Just wondering if it’s possible at all. I’ve tried everything I could think of, but we either end-up with:

> echo $FOO_PATH
# Outputs nothing


> echo $FOO_PATH
/foo # This is not what we want