Results 1 to 4 of 4
I want to set paths via my own script (paths.sh):
Code:
export PATH=$PATH:/usr/bin/python2.5:~/www/bin
export PYTHONPATH=$PYTHONPATH:/usr/bin/python2.5:~/www/site-packages
echo -e "PATH-->$PATH \n PYTHONPATH--->$PYTHONPATH"
mainly because I fo not have an access to my ...
- 08-17-2011 #1Just Joined!
- Join Date
- Oct 2009
- Posts
- 2
set $PATH via ./paths.sh
I want to set paths via my own script (paths.sh):
mainly because I fo not have an access to my home folder, so no bash.rcCode:export PATH=$PATH:/usr/bin/python2.5:~/www/bin export PYTHONPATH=$PYTHONPATH:/usr/bin/python2.5:~/www/site-packages echo -e "PATH-->$PATH \n PYTHONPATH--->$PYTHONPATH"

my question is why after running the script ./paths.sh
there is no effect!!
if I execute the commands manually one by one, it is all OK.
maybe I'm missing something in the script?
- 08-17-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
source your file, instead of running it, e.g.:
Code:. paths.sh
- 08-17-2011 #3Just Joined!
- Join Date
- Oct 2009
- Posts
- 2
hmm it works!
so whats the difference?
- 08-17-2011 #4Linux Guru
- Join Date
- May 2011
- Posts
- 1,838
When you run it (./paths.sh), you are doing everything in a new shell (which then exist when the script completes). When you source it (. paths.sh), you are doing everything in your current shell. This is how profiles scripts work (/etc/bashrc, ~/.bashrc, etc.), they are sourced at login time.


Reply With Quote