Reputation: 1618
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
Reputation: 72687
To add ~/bin
to your path:
First, we make the folder (if it isn't already made).
mkdir ~/bin
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).
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:
Open ~/.zshrc
.
At the end, add the line:
export PATH=$PATH:~/bin
This will add ~/bin
to your $PATH
.
Close the terminal window, and re-open it. (Or open a new one).
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).
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