Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have a file with the content:

export PATH=$PATH:$HOME/PyModel/bin

When I try to run this file it opens with the text editor. I want to run this file so that the path is appended in my mac os.

Please help!! Thanks in advance.

share|improve this question
up vote 2 down vote accepted


source filename

should do the trick.

share|improve this answer

Place the following on the first line of the file:


Rename the file extension to .sh. So if the filename is file.txt now it will be called

Don't forget to make it executable:

chmod a+x

And finally, run it with ./:

share|improve this answer
Although this technically is a way to "run this file", you do know that this will do nothing effective, ne? It won't modify the path in the way that the questioner wants. – JdeBP Dec 18 '13 at 18:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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