pixel 67
pixel 67

Reputation: 1618

Customizing a zsh shell

I am trying to modify my terminal by following this tutorial.

But I can't seem to copy the batchange.py file to my $PATH, I tried cp batchange.py ~/.bin and everything else I can think of.Here is my $PATH: '/Users/anthonybrown/.rvm/gems/ruby-1.9.3-p125/bin:/Users/anthonybrown/.rvm/gems‌​/ruby-1.9.3-p125@global/bin:/Users/anthonybrown/.rvm/rubies/ruby-1.9.3-p125/bin:/‌​Users/anthonybrown/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11‌​/bin:/usr/local/git/bin' –

Upvotes: 0

Views: 247

Answers (1)

simont
simont

Reputation: 72687

To add ~/bin to your path:

  1. First, we make the folder (if it isn't already made).

    mkdir ~/bin
    
  2. Copy batcharge.py into ~/bin:

    cp batcharge.py ~/bin/batcharge.py
    

    (Obviously you'll want to do this from where-ever the batcharge.py script is located).

  3. Check if ~/bin is in your path:

    echo $PATH | grep ~/bin
    

    This should come back with a line. If it does not, we shall add it:

    1. Open ~/.zshrc.

    2. At the end, add the line:

      export PATH=$PATH:~/bin
      

      This will add ~/bin to your $PATH.

    3. Close the terminal window, and re-open it. (Or open a new one).

    4. Type echo $PATH | grep ~/bin. This should now show a line (and you should see ~/bin at the end of the long-ish list of paths).

  4. Now, we test: you should be able to type which batcharge.py and see that zsh knows where to find it. For example, type which batcharge.py in terminal, and you should see something like:

    /Users/simont/bin/batcharge.py
    

    Now we can type batcharge.py and see the script run :)

Upvotes: 1

Related Questions