
How do I tweak my PATH?
A reader writes:
"I've got a few of your books and today picked up Wicked Cool Shell Scripts, which I'm very much looking forward to working with. Open up that file (or create one if you don't have it yet) by using vi, pico, emacs, jove, or whatever else is your favorite editor in Terminal.app. Then append your desired directory to the end of the existing PATH value like so: export PATH="${PATH}:/Users/joe/bin"Close that terminal window and open another (File -> New Shell), then type echo $PATH and you should see your specified path appended to the end. Then just make sure you have that directory (you can use mkdir ~/bin to create it if needed). Now you can drop scripts and programs into that file to your heart's content, and they'll automatically be found when you type in their names to the shell. Note that there's a slight variation on this that can work too, and that might be more commonly used, as demonstrated by this actual entry in my own ~/.bash_login file: PATH="${PATH}:/sw/bin:/usr/X11R6/bin:/Users/taylor/bin"; export PATHHope that helps clear things up!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.
Categorized:
Unix and Linux Help
(Article 3689)
Tagged: Previous: How do I get my environment to come along when I "su"? Next: Chopping off the last field of each line? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.
Rather amazingly, there are no comments on this article yet.
I have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]() Join Me At:
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|