I know there are quite some answers about that, but still could not make my way around it. I read all this and tried to follow the example under System-wide environment variables (for my case of course), and also tried to do as the chosen answer here. But didn't work.
So, I have an executable shell script, located in ~/Developer/android-studio/bin
and I want to make it so that when I am in the terminal (no matter were) and I write simply android-studio
and the script to be executed (the IDE to start).
So, I tried with export AS=$PATH:~/Developer/android-studio/bin
and also with
AS="~/Developer/android-studio/bin:${PATH}"
export AS
and then source .bashrc
, but after both tries, when I write simply AS
I get command not found
. How can I make this work?
Another question - is it obligatory that I name the variable with capitals only and no dashes, because I want to name the variable something like android_studio
instead of AS
, i.e.?
PATH=...
I add my directory to the $PATH env. variable, right? And then how would I denoteandroid_studio
to correspond to the added directory? (if we exclude the last line that you wrote with the function). – Milkncookiez Oct 22 '14 at 21:08