added bash env variable dir expansion