Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using Mac OS 10.8. I ran the /sw/fink/bin/init.sh script using the bash command which was supposed to make the fink/bin folder part of the $PATH variable for the current session.

The fink command didn't work, so I ran the script again with the . command which I was told was equivalent to the source command; I was able to call fink now without an absolute path.

Why did . work and not bash? Is it because the sh and bash commands run with their own temporary $PATH variable?

share|improve this question
1  
Mac OS 10.8 is a derivative of Ubuntu since when? –  Rinzwind Feb 7 '13 at 7:30
    
This is also relevant to Ubuntu users, don't be a d**k –  Anthony Feb 7 '13 at 10:58
    
No it is not otherwise you would have used Ubuntu in the topic. Different OS's have different ways of doing things and all we know is about how Ubuntu works. So -all- answers you get will be based on Ubuntu and it can be very very dangerous (well probably not in this case ;) ) to assume methods that work on Ubuntu work on other systems that are not Ubuntu related. And if even MINT questions get hammered down why would MAC OS stay open? If anything this should have been asked on unix.stackexchange.com and not here. And please do not blame me when you are doing it wrongly ;) –  Rinzwind Feb 7 '13 at 13:46
add comment

closed as off topic by Rinzwind, Uri Herrera, hhlp, Web-E, raaz Feb 7 '13 at 14:10

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

bash somescript will start a new bash shell, evaluate your script and then exit. The script will see a copy of your current environment, but any changes will be discarded when the script ends.

. somescript or source somescript will evaluate the script in your current context, so changes to existing environment variables, or the setting of new ones, will be retained.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.