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.

This is showing some of my rust when it comes to work with *nix like systems - or I can just blame it on the fact that I'm new to Mac OSX.

Question is, if I have a program at location, say:

/usr/local/bin/pdftotext

what steps can I take to make sure I can run pdftotext from anywhere. In other words, what configuration file do i have to modify (or anything else I can do) to make sure that, no matter what directory I'm in, a call to pdftotext will succeed?

share|improve this question

migrated from stackoverflow.com Nov 8 '11 at 4:07

This question came from our site for professional and enthusiast programmers.

1  
Use the full path and it should always succeed. –  minitech Nov 8 '11 at 4:05
    
yes, but i don't know what the full path with be on the other machine that this code will run on. so instead of hard-coding the full path, i'd like to emulate the production environment. –  Ramy Nov 8 '11 at 4:08
    
Then put it in a configuration file and have the application load it. (My original comment was meant as a bit of a joke.) –  minitech Nov 8 '11 at 4:09
    
Did you install homebrew? –  slhck Nov 8 '11 at 8:49
add comment

1 Answer

up vote 1 down vote accepted

You need to modify one of your shell's variables called $PATH, by adding the directory containing the program.

If you do it in your shell's configuration file, it will still work in subsequent shell sessions.

So basically, you want to add this to your ~/.bash_profile. (assuming you're using terminal/bash)

export PATH=$PATH:/usr/local/bin
share|improve this answer
add comment

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.