<div dir="ltr"><div>OK.. Tried to work around this limitation by adding spaces and $HOME is now expanded into the location directory. Hmm... I kind of see why we're doing this. Maybe, better to fix load_env()?</div><div><br></div><div>Huidae<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 29, 2019 at 8:59 PM Huidae Cho <<a href="mailto:grass4u@gmail.com">grass4u@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div><br></div><div>Currently, .grass7/bashrc is partially broken. This file is read by two functions in the startup script: load_env() and *_startup() (<a href="https://trac.osgeo.org/grass/ticket/3462" target="_blank">https://trac.osgeo.org/grass/ticket/3462</a>). Commenting out export lines in .grass7/bashrc doesn't work because load_env() splits each line twice (once by space and once more by equal) to create environment variables without ignoring commented lines. It doesn't matter whether a line is alias or export, or whatever as long as it contains one space and one equal sign. Also, load_env() doesn't expand environment variables in each line. For example, the following two lines:<br></div><div><br></div><div>alias vi='vim'</div><div>#export PATH="$PATH:grass/scripts"</div><div>export GDAL_DRIVER_PATH="$HOME/gdalplugins"</div><div><br></div><div>would create three environment variables:</div><div><br></div><div>vi="'vim'"</div><div>PATH="...grass paths...:\$PATH:grass/scripts"</div><div>GDAL_DRIVER_PATH="\$HOME/gdalplugins"</div><div><br></div><div>The first variable is not meant to be created at all, PATH shouldn't be modified because it's commented out, and GDAL_DRIVER_PATH is not usable because $HOME is not expanded.</div><div><br></div><div>Now, my question is why do we need a separate function load_env() to "manually" create environment variables instead of just writing out all these lines into .bashrc in the mapset and letting bash handling everything? Is it by design or a bug?<br></div><div><br></div><div>Regards,</div><div>Huidae<br></div><div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><div dir="ltr">Huidae Cho, Ph.D., GISP, PE (MD), CFM, M.ASCE<br>Open Source GIS Developer, GRASS GIS Development Team</div></div></span></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><div dir="ltr">Huidae Cho, Ph.D., GISP, PE (MD), CFM, M.ASCE<br>Open Source GIS Developer, GRASS GIS Development Team</div></div></span></div></div></div></div></div></div></div></div>