Loading .bash_profile of a new user automaticaly

maelamrani

Member
Joined
Jan 3, 2020
Messages
77
Reaction score
7
Credits
450
Hello,
After i setup postgres packages i wanna load the .bash_profil after using su - postgres
because i use

source ~/.bash_profil

-bash-4.2$ cat ~/.bash_profil
[ -f /etc/profile ] && source /etc/profile
PGDATA=/opt/rh/postgresql92/root/var/lib/pgsql/data
export PGDATA
PATH=$PATH : opt/rh/postgresql92/root/usr/bin
export PATH
-bash-4.2$

to charge it
So what should i do to not use source and its load automatically?

kind regards,
 


You might be missing an "e".
Usually that file is bash_profile.

If you don't want to use it. Simply don't run the "source" command you have above.

If you don't want to type "source".
rename the file to .bash_profile (with an e at the end)
or add the lines you have above to the end of .bashrc

These files should be in your home directory, owned by you.
They must have a period at the beginning of the file name.
 
  • Like
Reactions: Rob

Staff online

Members online


Top