Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Mac OS 10.8. I ran the /sw/fink/bin/ 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

closed as off topic by Rinzwind, Uri Herrera, hhlp, Web-E, Raja 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.

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 and not here. And please do not blame me when you are doing it wrongly ;) – Rinzwind Feb 7 '13 at 13:46

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

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