So I am trying to write a script which compiles VMAF from the GIT and I need to change the PYTHONPATH location to the installation directory. The script is working good, and it is installing VMAF, but the problem is that when I source the changes in .bashrc it is valid until the bash script completes, and I want to make them globally. I understand that the bash process is isolating the changes but is there a way to execute the source that it persists the execution of the script? This is my code:
#!/bin/bash mkdir $HOME/install sudo apt-get install python-dev python-pip python-tk -y sudo pip install --upgrade scikit-learn h5py numpy scipy matplotlib pandas cd $HOME/install git clone https://github.com/Netflix/vmaf.git cd $HOME/install/vmaf make echo "export PYTHONPATH=$HOME/install/vmaf/python:\$PYTHONPATH" | sudo tee -a $HOME/.bashrc echo "alias ll='ls -al --color'" | sudo tee -a $HOME/.bashrc source $HOME/.bashrc ./unittest
/etc/profile.d/
add global aliases to/etc/bash.bashrc
or/etc/bashrc
depending on your distro (see/etc/profile
around line 18# Source global bash config
(works only for interactive shells)