Script Save directory set with Environment Variables

I’d like to setup the default output directory / mocha project directory.

I use nuke from terminal sessions where the following variables are set…
DIR=/Users/name/projects
JOB=jobname
SHOT=shot_010

and would like to start operating mocha in the same fashion.
So, i’d like to set the default output directory as follows…

path:
/Users/name/projects/jobname/shots/shot/mocha/

path as with Environment Variables:
$DIR/$JOB/shots/$SHOT/mocha/

how do i get mocha to lacuna from terminal and read the environment variables?

Thanks.