LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-20-2009, 03:20 AM   #1
richard158
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
setting path for plugins


hi

i am using ubuntu and i am a recent escapee from windows. I am using Codesourcery to carry out arm programming with linux. Codesourcery is not in my command path so i manually alter it using the PATH command and it works ok.

But i want to set it so i do not have to alter the command path manually. I have read can do this by editing bashrc and bash profile. When i look in my bash_profile file it says:

-----------------------------------------------------------------------
# New environment setting added by Sourcery G++ Lite for ARM GNU/Linux on Thu Oct 15 18:23:49 GMT 2009 1.
# The unmodified version of this file is saved in /home/richard/.bash_profile1387769153.
# Do NOT modify these lines; they are used to uninstall.
PATH="/home/richard/CodeSourcery/Sourcery_G++_Lite/bin:${PATH}"
export PATH
# End comments by InstallAnywhere on Thu Oct 15 18:23:49 GMT 2009 1.
-----------------------------------------------------------------------

this must have been set when i installed codesourcey. and the file .bash_profile1387769153 is empty . this codesourcery path does not work as my path is:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

how can i automatically add codesourcey to my path?

thanks
Richard
 
Old 10-20-2009, 03:45 AM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 101Reputation: 101
Quote:
Originally Posted by richard158 View Post
hi

i am using ubuntu and i am a recent escapee from windows. I am using Codesourcery to carry out arm programming with linux. Codesourcery is not in my command path so i manually alter it using the PATH command and it works ok.

But i want to set it so i do not have to alter the command path manually. I have read can do this by editing bashrc and bash profile. When i look in my bash_profile file it says:

-----------------------------------------------------------------------
# New environment setting added by Sourcery G++ Lite for ARM GNU/Linux on Thu Oct 15 18:23:49 GMT 2009 1.
# The unmodified version of this file is saved in /home/richard/.bash_profile1387769153.
# Do NOT modify these lines; they are used to uninstall.
PATH="/home/richard/CodeSourcery/Sourcery_G++_Lite/bin:${PATH}"
export PATH
# End comments by InstallAnywhere on Thu Oct 15 18:23:49 GMT 2009 1.
-----------------------------------------------------------------------

this must have been set when i installed codesourcey. and the file .bash_profile1387769153 is empty . this codesourcery path does not work as my path is:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

how can i automatically add codesourcey to my path?

thanks
Richard
Do you want to be able to find and execute a program without adding to your path? If so, do it this way:

Code:
# ln -nsf (full path to executable) /usr/local/bin
The above command creates a symbolic link from your executable to a common directory that is part of your path. After you have done this, you can type the name of the program you want -- just like any other -- and it will run without any changes to your path.

The same trick can be used for any other programs that are not installed in the system directories.

BUT ... if your target program needs to run additional executables from the special directory, the above trick won't work. In that case, you can write a shell script that adds to your path as shown in your post, and then executes the required program. Like this:

Code:
#!/bin/bash
export PATH="/home/richard/CodeSourcery/Sourcery_G++_Lite/bin:${PATH}"
(name of program to be executed)
Put the above in a conveniently named script (scriptname.sh), give it executable permissions, and execute it whenever you want to run the special programming environment.
 
Old 10-20-2009, 06:00 AM   #3
richard158
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Original Poster
Rep: Reputation: 0
i am using Eclipse to write C programs, eclipse searches the path for the gcc component. so would:

#!/bin/bash
export PATH="/home/richard/CodeSourcery/Sourcery_G++_Lite/bin:${PATH}"
(name of program to be executed)

solve this problem?

thanks
Richard
 
  


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
Setting the path powerlifter450 Linux - Software 18 07-05-2006 10:46 AM
/usr/lib/mozilla/plugins not valid install path for macromedia flash player 7? dr_zayus69 Linux - Software 2 08-14-2005 10:13 AM
setting a path stasch Linux - Software 4 05-28-2005 03:45 AM
setting a path mjkramer Linux - Newbie 8 11-18-2004 07:35 PM
PATH SETTING webboss Linux - Newbie 2 03-17-2001 05:29 PM


All times are GMT -5. The time now is 10:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration