1

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.

2

Running:

source filename

should do the trick.

0

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
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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