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 06-22-2004, 02:53 AM   #16
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 46

Yes, sorry I forgot that part. When making changes to /etc/profile or ~/.bashrc you either have to log out and back in or *source* them.

Code:
source /etc/profile
 
Old 06-22-2004, 02:58 AM   #17
jing
Member
 
Registered: May 2004
Location: Singapore
Posts: 30

Original Poster
Rep: Reputation: 15
Talking

Really thankful for you help!
Yes it can be run now.
Thousands of thanks
 
Old 06-22-2004, 03:00 AM   #18
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 46
You're most welcome. Glad it's working
 
Old 06-22-2004, 04:16 AM   #19
jing
Member
 
Registered: May 2004
Location: Singapore
Posts: 30

Original Poster
Rep: Reputation: 15
uh oh..
just found out that the commands other than clustalw will not work again..
ls, cd and all.
Then i did a
export PATH=$PATH:/bin:
ls, cd and some commands worked.
But not whereis, rmmod, cluster-fork.

Anymore suggestions?
These paths are going to drive me crazy..
 
Old 06-22-2004, 11:29 AM   #20
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
I think you may need to take a step back and spend a few minutes looking at a larger picture so you don't get lost in details.
Think for a moment about what your $PATH is. I may say some things here that are obvious, but it may help.

$PATH is a variable which lists a string of directories that applications search for executable files. Using these directories allows you and your scripts to call applications without the need for an exact path to these commands. It's kinda like saying "I'm going to Sam's house"...you don't need to say "I'm going to Sam's house at 15 Rogers Street, Chicago, Illinois" because the path to his house is already known.

There are a few files which set what directories are in $PATH. /etc/profile and/or /etc/bashrc set a global $PATH, and $HOME/.bashrc sets the $PATH for individual users.
With $HOME/.bashrc you can either append directories to the global $PATH or you can completely replace it with your own $PATH. If you want to append, you must include "$PATH" in the value of your new $PATH: PATH=$PATH:~/bin:/opt/firebird:~/scripts
If you do not include the original $PATH, your new path will consist of only the directories listed in $HOME/.bashrc, and the global $PATH will be ignored.

The global $PATH is usually already set with the essential system binary directories such as /bin and /usr/bin. If you find that a lot of standard commands don't work anymore, chances are you either removed the paths from the global $PATH or you replaced the global $PATH completely (failed to include "$PATH" in your local $PATH).

First thing I'd do is check the global settings, located in /etc/profile or perhaps a bash configuation file such as /etc/bashrc or /etc/bash.bashrc. This should show you all the standards:
/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin...if all of these (and perhaps a few more) are not set in /etc/profile, you're likely to have trouble.

What I like to do is LEAVE GLOBAL FILES ALONE as much as possible, and use only local configuration files whenever I can. Setting a $PATH locally to me means appending only...I leave the $PATH in /etc/profile as it is and add directories to it in $HOME/.bashrc, as mentioned above.

As an added note, your $PATH may be altered by other scripts beyond /etc/profile and $HOME/.bashrc. It's possible that you have afaulty script somewhere that completely replaces $PATH instead of appending to it.

I hope this helps a little.

Last edited by mikshaw; 06-22-2004 at 11:31 AM.
 
Old 06-22-2004, 09:15 PM   #21
jing
Member
 
Registered: May 2004
Location: Singapore
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks milkshaw.
My echo $PATH show
/opt/BioBrew/ClustalW/1.8.3/bin:/usr/local/sbin:/opt/BioBrew/ClustalW/1.8.3/bin:/usr/local/sbin:/opt/BioBrew/ClustalW/1.8.3/bin:/bin::/usr/X11R6/bin:/opt/ganglia/bin:/opt/maui/bin:/
And a lot of repeated paths..

When i tried to source /etc/profile:
bash: id: commad not found
[: =: unary operator expeeted
bash: id: command not found
bash: dircolors: command not found.

But in my /etc/profile i only have:
export PATH=/opt/BioBrew/ClustalW/1.8.3/bin:/usr/local/sbin:/sbin:$PATH
Where did the extra lines come from?

Somehow it works again.
Thanks for all the help!

Last edited by jing; 06-22-2004 at 11:29 PM.
 
  


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
startx problem mandrakewanta Linux - Newbie 2 05-07-2005 09:13 PM
when i startx the kde bring 2 bash program by it self Paxmaster Linux - General 1 11-11-2004 08:09 PM
Bug / Xwindows / startx : xinit works but startx crash www.rzr.free.fr Linux - Software 4 10-17-2004 09:06 AM
Startx problem jcnye Linux - Software 2 08-11-2004 12:37 AM
Startx problem HoRrIdPrObLeMs Linux - Newbie 9 03-05-2002 05:20 PM


All times are GMT -5. The time now is 08:40 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