RCPATH=~/.$(basename "$SHELL")rc
EXPORTGUARD="# PhASAR export guard"
if grep -Fxq "$EXPORTGUARD" "$RCPATH"
then
echo "Environment variables have already been set"
else
set the environment variables
It's logic is that If the .bashrc doesn't have the line # PhASAR export guard then the bash won't add environment variables into .bashrc.
Maybe it should reverse? (And I also do not know where the line # PhASAR export guard be added into bashrc).
It's logic is that If the .bashrc doesn't have the line
# PhASAR export guard
then the bash won't add environment variables into .bashrc.Maybe it should reverse? (And I also do not know where the line
# PhASAR export guard
be added into bashrc).