1

I have studio.sh file in my android-studio/bin folder, which I would like to use as a command in bash (like launching any other normal application).

I read somewhere that adding this line to ~/.profile should work,

export PATH=$PATH:/home/goel/android-studio/bin

But it doesn't work. Whats the correct process?

2
  • 1
    What do you mean by "doesn't work"? Commented Jan 21, 2015 at 8:43
  • I would avoid having a very long $PATH. Can't you decide to put all your executables (both programs & scripts - perhaps as symlinks) into $HOME/bin/ and add only that directory to your PATH ? Commented Jan 21, 2015 at 10:06

3 Answers 3

2

Add the script folder name to PATH environment variable in ~/bash.rc file and you can also create alias for you script in ~/bash.rc and source the /etc/bash.bashrc file, now you can issue your script or alias name in any terminal. Hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

~/bashrc is the commonly used file and don't forget to source ~/.bashrc after each modification.
0

If you change your PATH in a .profile, you still have to make the shell read the .profile. Starting a new terminal is sometimes not enough (some terminals don't read the .profile), in which case you have to log out and back in.

Comments

0

Is studio.sh executable? Have you tried ./studio.sh inside its containing folder to check whether it runs at all?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.