bashrc in opt/distra/bashrc changes are not reflecting permanently

240 views Asked by At

I have my bashrc file in /opt/distra/bashrc and trying to add a path in LD_LIBRARY_PATH variable but the changes are not reflecting after closing the terminal and re-starting and re starting the Linux Machine.

OS : Oracle Linux 7.7

My bashrc looks like this

# User specific environment variables 
export DISTRA_USER=$USER
export M2_HOME=/opt/maven/apache-maven-3.0.5
export JAVA_HOME=/usr/java/default
export BT3_HOME=/opt/distra/bt3
export LD_LIBRARY_PATH=/opt/oracle/product/18c/dbhomeXE/lib:/opt/distra/executive/current/lib:/opt/mqm/java/lib64

I am trying to add :/opt/mqm/java/lib64 to the LD_LIBRARY_PATH variable

I have to do . /opt/distra/bashrc everytime i start my machine. There must be some way that i am not aware of to make the change permanently.

What shall i do to make the changes permanent ?

Edit :

My .bashrc in home directory has the following lines:

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# Source distra definitions
if [ -f /opt/distra/bashrc ]; then
        . /opt/distra/bashrc
fi

My .bash_profile in home directory has the following lines:

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:$HOME/scripts
export PATH
1

There are 1 answers

1
Tommy Reynolds On

The line "export LD_LIBRARY_PATH=/opt/oracle/product/18c/dbhomeXE/lib:/opt/distra/executive/current/lib**:/opt/mqm/java/lib64**"

looks bogus because: 1) LD_LIBRARY_PATH should contain only directory paths, not individual library archive paths; and 2) since this entry is unquoted, the shell wildcards "**" will be expanded; I don't think this is what you really want. Try:

export LD_LIBRARY_PATH='/opt/oracle/product/18c/dbhomeXE/lib:/opt/distra/executive/current/lib:/opt/mqm/java/lib64'

i.e., enclose the value in single quotes. This really isn't necessary here but the single quotes will keep you safe from directories with embedded whitespace, not that you should actually use those on a Linux box.