Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a file with the content:

export PATH=$PATH:$HOME/PyModel/bin
export PYTHONPATH=$HOME/PyModel/pymodel:$PYTHONPATH
export PYTHONPATH=.:$PYTHONPATH

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

2 Answers 2

up vote 2 down vote accepted

Running:

source filename

should do the trick.

share|improve this answer

Place the following on the first line of the file:

#!/bin/bash

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

Don't forget to make it executable:

chmod a+x file.sh

And finally, run it with ./:

./file.sh
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

 
discard

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.