[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: problem, c, ++, excutable



-----Original Message-----
From: Jianping Zhu <zhujp98 hotmail com>
To: Redhat-list redhat com <Redhat-list redhat com>
Date: Friday, February 01, 2002 9:07 AM
Subject: problem, c, ++, excutable


>
>
>I am new linux user.
>
>I can compile my c++ code in my user directoy (for example /home/username)
but when I try to excute the the excutable I have to give the whole path(
/home/username myexcutable) even I am in the diretory /home/username, How
can I fix this problem.

You could just type it out this way:   ./myexecutable    if you are in the
same directory as the executable.  Otherwise, you need to add the directory
of your executable to your path.  In most cases, you can add this in
.bash_profile.  A line that looks a bit like this is usually present:
PATH=$PATH:$HOME/bin

Just change it to something like this
PATH=$PATH:$HOME/bin:/home/username/executable_directory

Hope this helps

Jeff Hogg





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]