LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-30-2012, 04:20 PM   #16
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,552

Rep: Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112Reputation: 2112

Remember to either log out and back in, or source the $HOME/.bashrc file before trying to use the updated PATH.
Code:
source $HOME/.bashrc

or simply

source ~/.bashrc
If you run "echo $PATH", it should print out your new directory as well as the others if you've done it correctly. The output posted above does not show this new location as part of the PATH, so make sure you're exporting it (you seem to be), and that you source it (or log out and back in) before trying to use it.

You'll need to adjust the directory location in the alias as well if you want to go that route, it's still pointing to "$HOME/rich/". The alias would also need to point to the script itself, not the directory:
Code:
alias ndk-build="$HOME/X/Development/Android/android-ndk-r8/ndk-build"
Remember, the PATH tells the machine "when I type the name of any program, look in these directories until you find it". Meanwhile, "alias A=B" tells the machine "when I type A, what I really mean is B". You only need one or the other, both would be redundant.

Last edited by suicidaleggroll; 05-30-2012 at 04:29 PM.
 
1 members found this post helpful.
Old 05-30-2012, 04:33 PM   #17
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Actually the command echo $PATH revealed that .bashrc was ignored. Now we have to deepen into this, which is the main topic of this thread. Please (be patient) can you post the output of the following commands?
Code:
echo $SHELL
echo $0
Then you can try to put an echo statement in every (dot)file you have in your home directory and which is supposed to be sourced every time you start a new shell session. For example, add
Code:
echo this is .profile
in $HOME/.profile,
Code:
echo this is .bash_profile
in $HOME/.bash_profile and so on. I admit this is a crude way to debug, but it is in my opinion the only and effective way to be conscious of which file(s) are actually sourced by your shell.
 
Old 05-30-2012, 05:47 PM   #18
fidian
LQ Newbie
 
Registered: May 2012
Posts: 2

Rep: Reputation: Disabled
You may get some benefit from this page: https://help.ubuntu.com/community/EnvironmentVariables

It goes over the various files that could set environment variables. For me, the .pam_environment file did the trick and let me run ndk-build from eclipse by putting it into the path of my window manager, not just putting it in the path for bash.
 
Old 06-02-2012, 12:51 PM   #19
Taylrl
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 0
Thanks! With your help I have finally managed to crack it.

Cheers for all your help people!
 
Old 06-02-2012, 01:05 PM   #20
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by Taylrl View Post
Thanks! With your help I have finally managed to crack it.
Just out of curiosity, how did you end up?
 
Old 06-02-2012, 03:08 PM   #21
Taylrl
Member
 
Registered: Jul 2010
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 0
I added

Code:
alias ndk-build="$HOME/X/Development/Android/android-ndk-r8/ndk-build"
to my /.bashrc file. It seems very simple now, but then it's always simply when you know how I guess!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
adding sth. to all users' PATH variable (sudo included) tpresa Linux - Software 2 08-03-2010 04:16 PM
Adding a executable file $PATH Variable ajeet@linux Solaris / OpenSolaris 3 03-18-2010 01:30 PM
Add path to $PATH variable alaios SUSE / openSUSE 2 04-19-2009 09:41 AM
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 06:48 PM
Adding JavaVM to PATH variable? Crickit Linux - Software 3 05-06-2003 04:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration