The /etc/profile.local
file used to be the location to make system specific changes that would not be overwritten when /etc/profile
would get an update.
Your system might still source the file if it exists, you could either check /etc/profile
to see if it does (search for the profile.local
filename, or just create the file and try out.
However, if you have a directory /etc/profile.d
, and if your /etc/profile
has something like (this is from Ubuntu 12.04) the following in it:
if [ -d /etc/profile.d ]; then
for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
. $i
fi
done
unset i
fi
then this mechanism sources (. $i
) each of the files found in that directory.
That is a more modern solution to the single .local
file (with the advantage of different packages being able to drop in their files and remove them as needed without breaking something else). If your OpenSUSE has something like that, you can just create a file /etc/profile.d/your_name.sh
and put the required code in there.
If you don't have all of that you can add the lines directly to /etc/profile
, but you do run the risk of loosing your changes on a package upgrade.