I have already referred to this post and post.
I would like to set few variables as global/system level environment variables which I would like to initialize once and be available anytime I login. I don't wish to reassign them again and again.
Below are what I did.
Step - 1 (in command line terminal)
export SPARK_HOME="/usr/spark"
export PATH="$PATH:/usr/spark/bin"
export PYTHONPATH="$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.7-src.zip:$PYTHONPATH"
export PATH="$SPARK_HOME/python:$PATH"
Step - 2 (in .bashrc file)
export SPARK_HOME="/usr/spark"
export PATH="$PATH:/usr/spark/bin"
export PYTHONPATH="$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.7-src.zip:$PYTHONPATH"
export PATH="$SPARK_HOME/python:$PATH"
step -2a refresh/reload bashrc file
source .bashrc
The above two steps didn't work. Meaning once I logout and login, when I issue printenv
command, I don't see them
So, I thought of navigating to the below folder based on SO posts
cd /etc/environment -what should I do in this file?
cd /etc/profile - what should I do in this file?
cd /etc/profile.d/ - I see 4 files here as shown below (don't know what to do from here)
apps-bin-path.sh bash_completion.sh cedilla-portuguese.sh gtk-accessibility.sh vte-2.91.sh
My profile file looks like as below
if [ "$PS1" ]; then
if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
How can I set these environment variables for eternity? However many terminals I open, I would like to have them and use them.