Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to be able to run program from anywhere without adding ./, so I edited ~/.bashrc to contain this line

export PATH=$PATH:.

Now when I type echo $PATH I get

[......]:/home/yotam/omnetpp-4.2.2/bin:.: No such file or directory

Why is that? Also, I'm not sure about why using export, I get the same result if I just type PATH=$PATH:more_valuew without export. So what's the difference?

Thanks!

share|improve this question
up vote 1 down vote accepted

Only the command contained to the directory described to the environment variable PATH can perform without ./ .

In this case, if you want to add current directory in PATH,

Replace to this:

export PATH=$PATH:./:

In General :

To make a temporary change the value of an environment variable enter the command:

VARNAME=value_of_variable

This value will remain until you exit from the shell you are working in.

To make other programs that use the variable aware of the new value enter the command:

export VARNAME
share|improve this answer
    
Oh well the omnetpp is no really related to the issue, my bed. I just want to be able to run programs from anywhere so I want ./ to be in my PATH – Yotam Aug 16 '12 at 9:07
    
OK, I rewrote the above description. – vine_user Aug 16 '12 at 9:31
    
thanks man! got it – Yotam Aug 16 '12 at 13:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.